MRTG nasce per Monitoring di ROUTER Riesce a



![File di configurazione Work. Dir: /d 1/mrtg/html Thresh. Dir: /d 1/mrtg/thresh Title[^]: Padova LAN File di configurazione Work. Dir: /d 1/mrtg/html Thresh. Dir: /d 1/mrtg/thresh Title[^]: Padova LAN](https://slidetodoc.com/presentation_image/4c00060adeb9bfd50c44a24cbd061325/image-4.jpg)

![File di configurazione # Temperature # Max. Bytes[pdags 2. temp]: 100 Target[pdags 2. temp]: File di configurazione # Temperature # Max. Bytes[pdags 2. temp]: 100 Target[pdags 2. temp]:](https://slidetodoc.com/presentation_image/4c00060adeb9bfd50c44a24cbd061325/image-6.jpg)
![File di configurazione # # User and Process # Max. Bytes[ospd 00. usr. proc]: File di configurazione # # User and Process # Max. Bytes[ospd 00. usr. proc]:](https://slidetodoc.com/presentation_image/4c00060adeb9bfd50c44a24cbd061325/image-7.jpg)

![Monitor disco locale # Spool Disk Usage on ospd 03. # Target[spool. disk. alloc]: Monitor disco locale # Spool Disk Usage on ospd 03. # Target[spool. disk. alloc]:](https://slidetodoc.com/presentation_image/4c00060adeb9bfd50c44a24cbd061325/image-9.jpg)





![Nell’albero di un linux [michelot@pcferrari noi]$ snmpwalk lxde 01 public. 1. 3. 6. 1. Nell’albero di un linux [michelot@pcferrari noi]$ snmpwalk lxde 01 public. 1. 3. 6. 1.](https://slidetodoc.com/presentation_image/4c00060adeb9bfd50c44a24cbd061325/image-15.jpg)










- Slides: 25
MRTG nasce per Monitoring di ROUTER Riesce a monitorare qualsiasi contatore SNMP Quindi anche la maggior parte degli switch “managed” Ma anche computer general purpose. 18 Ottobre 2000 CNAF Michele Michelotto
MRTG nasce per Monitoring di ROUTER Riesce a monitorare qualsiasi contatore SNMP Quindi anche la maggior parte degli switch “managed” Ma anche computer general purpose. 18 Ottobre 2000 CNAF Michele Michelotto
I log files Ospd 03. pd. infn. it> more garrb-16 aal 5. log 971780102 385491343 3262750497 971780102 108110 136510 971779202 82392 563641 971779200 82392 563641 971778900 82392 563641 971778600 82360 563533 82392 563641 971778300 72999 531482 971778000 72999 531482 971777700 72898 529309 72999 531482 971777400 57987 205656 971777100 57987 205656 Ultimo Valore Valori recenti . . omissis. . 971548200 971546400 971544600 971542800 971541000 971539200 971537400 11477 11948 14928 15044 19427 13598 15470 86393 15353 118439 89613 15353 118439 264001 17118 390472 201285 18408 390472 141293 27024 163605 66418 27024 163605 130078 16533 148518 18 Ottobre 2000 CNAF Michele Michelotto Valori mediati
File di configurazione Work. Dir: /d 1/mrtg/html Thresh. Dir: /d 1/mrtg/thresh Title[^]: Padova LAN - Monitoring with MRTG Page. Top[^]: <H 1> INFN Padova LAN devices </H 1><p> Write. Expires: Yes With. Peak[_]: ymw # # ospd 00 # Page. Top[ospd 00 feth]: In and Out Octets on ospd 00 Fast Ethernet Max. Bytes[ospd 00 feth]: 12500000 Target[ospd 00 feth]: if. In. Octets. 1&if. Out. Octets. 1: public@ospd 00 #Unscaled[ospd 00 feth]: ymw With. Peak[ospd 00 feth]: ymw # USO il nome abbreviato 18 Ottobre 2000 CNAF Michele Michelotto
La temperatura del nostro router CISCO 18 Ottobre 2000 CNAF Michele Michelotto
File di configurazione # Temperature # Max. Bytes[pdags 2. temp]: 100 Target[pdags 2. temp]: 1. 3. 6. 1. 4. 1. 9. 9. 13. 1&1. 3. 6. 1. 4. 1. 9. 9. 13. 1. 3. 3: public@pdags 2 Page. Top[pdags 2. temp]: <H 1> Temperatura di pdags 2 </H 1> Options[pdags 2. temp]: gauge, noinfo, absolute, nopercent Short. Legend[pdags 2. temp]: ° C YLegend[pdags 2. temp]: Degree Celsius Legend 1[pdags 2. temp]: inlet Legend 2[pdags 2. temp]: outlet Legend 3[pdags 2. temp]: max-inlet Legend 4[pdags 2. temp]: max-outlet Legend. I[pdags 2. temp]: inlet Legend. O[pdags 2. temp]: outlet With. Peak[pdags 2. temp]: ym Thresh. Max. I[pdags 2. temp]: 26 Thresh. Prog. I[pdags 2. temp]: /d 1/mrtg/bin/threshold 2. pl Thresh. Prog. OKI[pdags 2. temp]: /d 1/mrtg/bin/threshold. OK 2. pl Uso l’ OID 18 Ottobre 2000 CNAF Michele Michelotto
File di configurazione # # User and Process # Max. Bytes[ospd 00. usr. proc]: 1000 Target[ospd 00. usr. proc]: 1. 3. 6. 1. 25. 1. 5. 0&1. 3. 6. 1. 25. 1. 6. 0: public@ospd 00 Page. Top[ospd 00. usr. proc]: <H 1> User and Process on ospd 00 </H 1> <BR><H 2><FONT COLOR=blue>Current Users</FONT> and <FONT COLOR=red>Current Process</FONT>< /H 2> Options[ospd 00. usr. proc]: gauge, noinfo, absolute, nopercent Short. Legend[ospd 00. usr. proc]: unit YLegend[ospd 00. usr. proc]: User and Process #Colours[ospd 00. usr. proc]: BLUE#1000 FF, RED#FF 0000, BLUE#1000 FF, RED#FF 0000 Legend 1[ospd 00. usr. proc]: users Legend 2[ospd 00. usr. proc]: processes Legend 3[ospd 00. usr. proc]: max users Legend 4[ospd 00. usr. proc]: max processes Legend. I[ospd 00. usr. proc]: Users Legend. O[ospd 00. usr. proc]: Procs With. Peak[ospd 00. usr. proc]: ymwd # Uso l’ OID 18 Ottobre 2000 CNAF Michele Michelotto
Lo spazio su disco Non c’è un contatore SNMP, si deve usare uno script 18 Ottobre 2000 CNAF Michele Michelotto
Monitor disco locale # Spool Disk Usage on ospd 03. # Target[spool. disk. alloc]: `/d 1/mrtg/script/diskspace. sh /dev/rz 2 a` Title[spool. disk. alloc]: Disk Usage /dev/rz 2 a (/ var) Page. Top[spool. disk. alloc]: <H 1> Disk Usage /dev/rz 2 a (/ var)</H 1> Options[spool. disk. alloc]: gauge, nopercent Max. Bytes[spool. disk. alloc]: 100 Unscaled[spool. disk. alloc]: dwmy With. Peak[spool. disk. alloc]: dwmy YLegend[spool. disk. alloc]: % Used Short. Legend[spool. disk. alloc]: % Legend 1[spool. disk. alloc]: Avg Percent Diskspace Used Legend 2[spool. disk. alloc]: Avg Percent Inodes Used Legend. I[spool. disk. alloc]: Diskspace Legend. O[spool. disk. alloc]: Inodes Thresh. Max. I[spool. disk. alloc]: 65 Thresh. Prog. I[spool. disk. alloc]: /d 1/mrtg/bin/threshold 2. pl Thresh. Prog. OKI[spool. disk. alloc]: /d 1/mrtg/bin/threshold. OK 2. pl 18 Ottobre 2000 CNAF Michele Michelotto
Script per disco locale !/bin/sh # by Michele Michelotto 18 Aug 1999 # Get various diskspace numbers for MRTG. # # This is the output format by df -k -i # usage: diskspace. sh Filesystem # i. e. diskpace. sh /dev/rz 2 a # where /dev/rz 2 a is the filesys. # retch=`df -k -i $1 | tail -1 | tr -d %` set $retch # break apart into fields using IFS seperators echo $5 # Percentage diskspace used echo $8 # Percentage inodes used 18 Ottobre 2000 CNAF Michele Michelotto
Threshold !/usr/local/bin/perl # Called when MRTG detects a threshold problem for a variable. # ARGV[0] = Parameter name, such as 'mpclm 1005. disk 0'. # ARGV[1] = Threshold value which was breached, such as "95". # ARGV[2] = Actual current value of the parameter, such as "100". # Example: thisprogram mpclm 1005 95 100 my($timestr, $param, $thresh, $value, $message, $logfile); $timestr = localtime(time); $param = $ARGV[0]; $thresh = $ARGV[1]; $value = $ARGV[2]; $logfile = "/tmp/mrtgthresh. log"; $emailprog = "/usr/bin/mailx -s 'MRTG Thresh of $param '"; $emailuser = "supporto@pd. infn. it"; # Do something meaningful with the information. # Send an email message, log to a file, execute some script. . . if ($thresh > $value) { $abovebelow = "below"; } else { $abovebelow = "above"; } $message. = "$param ($value) is $abovebelow threshold ($thresh)"; # Log it. open(LOG, ">>$logfile"); print LOG "$timestr $messagen"; close(LOG); # Email it. system("echo '$message' | $emailprog $emailuser"); exit(0); 18 Ottobre 2000 CNAF Michele Michelotto
I mail entranti e uscenti dal mail server 18 Ottobre 2000 CNAF Michele Michelotto
Mail. Server lo script !/usr/local/bin/perl 5 # this script relies on the sendmail. st file being activated. # the data is called via mailstats that run out of inetd, on port 7256. open (OLD, "</tmp/mailstat 01. old") or die "can't open file!n"; # read the old data while (<OLD>) { if ($. == "1") { $count = $_; } ($oldfrm, $oldto) = split (' ', $count); } close (OLD); $remote = "ospd 01"; $port = "7256"; $iaddr = inet_aton($remote) or die "no host: $remote"; $paddr = sockaddr_in($port, $iaddr); $proto = getprotobyname ('tcp'); socket (SOCK, PF_INET, SOCK_STREAM, $proto) or die "socket: $!"; connect (SOCK, $paddr) or die "connect: $!"; 18 Ottobre 2000 CNAF Michele Michelotto
Mail. Server lo script continua while (<SOCK>) { if ($. == "5" ) { $line = $_; ($a, $curfrm, $b, $curto, $c, $d) = split(' ', $line); # do some sums $msgsfrm = $curfrm - $oldfrm; $msgsto = $curto - $oldto; chomp $msgsfrm; chomp $msgsto; # open the old file for overwrite open (OLD, ">/tmp/mailstat 01. old") or die "can't open file!n"; # print the data for mrtg print "$msgsfrmn$msgston 1nospd 01n"; # print the data to the old file print OLD "$curfrm $curton"; } #endif } close (SOCK) or die "close: $!"; exit; $!"; 18 Ottobre 2000 CNAF Michele Michelotto
Nell’albero di un linux [michelot@pcferrari noi]$ snmpwalk lxde 01 public. 1. 3. 6. 1. 4. 1. 2021 | more enterprises. ucdavis. memory. mem. Index. 0 = 0 enterprises. ucdavis. memory. mem. Error. Name. 0 = swap enterprises. ucdavis. memory. mem. Total. Swap. 0 = 770900 enterprises. ucdavis. memory. mem. Avail. Swap. 0 = 767484 enterprises. ucdavis. memory. mem. Total. Real. 0 = 257728 enterprises. ucdavis. memory. mem. Avail. Real. 0 = 226200 enterprises. ucdavis. memory. mem. Total. Free. 0 = 31528 enterprises. ucdavis. memory. mem. Minimum. Swap. 0 = 16000 enterprises. ucdavis. memory. mem. Shared. 0 = 21648 enterprises. ucdavis. memory. mem. Buffer. 0 = 118108 enterprises. ucdavis. memory. mem. Cached. 0 = 68748 enterprises. ucdavis. memory. mem. Swap. Error. 0 = 0 enterprises. ucdavis. memory. mem. Swap. Error. Msg. 0 = 18 Ottobre 2000 CNAF Michele Michelotto
Nell’albero di un linux enterprises. ucdavis. la. Table. la. Entry. la. Index. 1 = 1 enterprises. ucdavis. la. Table. la. Entry. la. Index. 2 = 2 enterprises. ucdavis. la. Table. la. Entry. la. Index. 3 = 3 enterprises. ucdavis. la. Table. la. Entry. la. Names. 1 = Load-1 enterprises. ucdavis. la. Table. la. Entry. la. Names. 2 = Load-5 enterprises. ucdavis. la. Table. la. Entry. la. Names. 3 = Load-15 enterprises. ucdavis. la. Table. la. Entry. la. Load. 1 = 0. 36 enterprises. ucdavis. la. Table. la. Entry. la. Load. 2 = 0. 12 enterprises. ucdavis. la. Table. la. Entry. la. Load. 3 = 0. 03 enterprises. ucdavis. la. Table. la. Entry. la. Config. 1 = 12. 00 enterprises. ucdavis. la. Table. la. Entry. la. Config. 2 = 12. 00 enterprises. ucdavis. la. Table. la. Entry. la. Config. 3 = 12. 00 enterprises. ucdavis. la. Table. la. Entry. la. Load. Int. 1 = 35 enterprises. ucdavis. la. Table. la. Entry. la. Load. Int. 2 = 11 enterprises. ucdavis. la. Table. la. Entry. la. Load. Int. 3 = 2 enterprises. ucdavis. la. Table. la. Entry. la. Load. Float. 1 = Opaque: Float: 0. 360000 enterprises. ucdavis. la. Table. la. Entry. la. Load. Float. 2 = Opaque: Float: 0. 120000 enterprises. ucdavis. la. Table. la. Entry. la. Load. Float. 3 = Opaque: Float: 0. 030000 enterprises. ucdavis. la. Table. la. Entry. la. Error. Flag. 1 = 0 enterprises. ucdavis. la. Table. la. Entry. la. Error. Flag. 2 = 0 enterprises. ucdavis. la. Table. la. Entry. la. Error. Flag. 3 = 0 enterprises. ucdavis. la. Table. la. Entry. la. Err. Message. 1 = enterprises. ucdavis. la. Table. la. Entry. la. Err. Message. 2 = enterprises. ucdavis. la. Table. la. Entry. la. Err. Message. 3 = 18 Ottobre 2000 CNAF Michele Michelotto
Nell’albero di un linux enterprises. ucdavis. system. Stats. ss. Index. 1 = 1 enterprises. ucdavis. system. Stats. ss. Error. Name. 1 = system. Stats enterprises. ucdavis. system. Stats. ss. Swap. In. 1 = 0 enterprises. ucdavis. system. Stats. ss. Swap. Out. 1 = 0 enterprises. ucdavis. system. Stats. ss. IOSent. 1 = 0 enterprises. ucdavis. system. Stats. ss. IOReceive. 1 = 1 enterprises. ucdavis. system. Stats. ss. Sys. Interrupts. 1 = 13 enterprises. ucdavis. system. Stats. ss. Sys. Context. 1 = 15 enterprises. ucdavis. system. Stats. ss. Cpu. User. 1 = 0 enterprises. ucdavis. system. Stats. ss. Cpu. System. 1 = 0 enterprises. ucdavis. system. Stats. ss. Cpu. Idle. 1 = 14 enterprises. ucdavis. version. Index. 0 = 1 enterprises. ucdavis. version. Tag. 0 = 4. 0. 1 enterprises. ucdavis. version. Date. 0 = $Date: 1999/08/18 09: 51: 57 $ enterprises. ucdavis. version. CDate. 0 = Tue Oct 17 12: 51: 03 2000 18 Ottobre 2000 CNAF Michele Michelotto
La Farm di Delphi/CMS Uso della CPU 18 Ottobre 2000 CNAF Michele Michelotto
La Farm di Delphi/CMS System CPU User CPU 18 Ottobre 2000 CNAF Michele Michelotto
La Farm di Delphi/CMS Interrupt Context Switch 18 Ottobre 2000 CNAF Michele Michelotto
La Farm di Delphi/CMS IO Sent IO Received 18 Ottobre 2000 CNAF Michele Michelotto
La Farm di Delphi/CMS Real Memory Free Memory 18 Ottobre 2000 CNAF Michele Michelotto
Penso sia usato anche nella farm di D. G. O. 18 Ottobre 2000 CNAF Michele Michelotto
Possibili uso in WP 2. 4 Monitor di variabili SNMP in una farm Linux Script per chiedere via socket/inetd altri valori non SNMP Modifiche a SNMP su Linux per inserire nuove variabili Uso di RRD e front-end grafici separati con RRD separo la fase di acquisizione da quella di visualizzazione (on demand) 18 Ottobre 2000 CNAF Michele Michelotto
18 Ottobre 2000 CNAF Michele Michelotto

























