I opened file REQUIREMENTS under nagios-plugins-1.4.13 folder and read
check_snmp:
After I discovered that mrtg is also missing. In ubuntu I installed it easylly by typing in console apt-get install mrtg. After I created by the template file mrtg.cfg. That contains next:
WorkDir: /var/lib/mrtg
Options[_]: growright,bits
Target[10.0.7.1]: 1:[email protected]
MaxBytes[10.0.7.1]: 1250000
Title[10.0.7.1]: : ISA-Server
Target[10.0.7.2]: 2:[email protected]
MaxBytes[10.0.7.2]: 1250000
Title[10.0.7.2]: : VM-Server
Target[10.0.7.3]: 3:[email protected]
MaxBytes[10.0.7.3]: 1250000
Title[10.0.7.3]: : MIRI
Target[10.0.7.4]: 4:[email protected]
MaxBytes[10.0.7.4]: 1250000
Title[10.0.7.4]: : MARTIS
After did install and got the text:
root@ubuntu:/home/user# env LANG=C mrtg /home/user/mrtg.cfg
SNMP Error:
no response received
SNMPv1_Session (remote host: “10.0.7.10” [10.0.7.10].161)
community: "public"
request ID: 35938326
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/share/perl5/SNMP_util.pm line 492
SNMPGET Problem for ifInOctets.1 ifOutOctets.1 sysUptime sysName on [email protected]::::::v4only
at /usr/bin/mrtg line 2207
2009-06-06 17:48:10: WARNING: skipping because at least the query for ifInOctets.1 on 10.0.7.10 did not succeed
2009-06-06 17:48:10: WARNING: no data for ifInOctets&ifOutOctets:[email protected]. Skipping further queries for Host 10.0.7.10 in this round.
2009-06-06 17:48:20: ERROR: Target[10.0.7.1][IN] ’ $target->[0]{$mode} ’ did not eval into defined data
2009-06-06 17:48:20: ERROR: Target[10.0.7.1][OUT] ’ $target->[0]{$mode} ’ did not eval into defined data
2009-06-06 17:48:20, Rateup WARNING: /usr/bin/rateup Can’t remove 10.0.7.1.old updating log file
2009-06-06 17:48:20: ERROR: Target[10.0.7.2][IN] ’ $target->[1]{$mode} ’ did not eval into defined data
2009-06-06 17:48:20: ERROR: Target[10.0.7.2][OUT] ’ $target->[1]{$mode} ’ did not eval into defined data
2009-06-06 17:48:20, Rateup WARNING: /usr/bin/rateup Can’t remove 10.0.7.2.old updating log file
2009-06-06 17:48:20: ERROR: Target[10.0.7.3][IN] ’ $target->[2]{$mode} ’ did not eval into defined data
2009-06-06 17:48:20: ERROR: Target[10.0.7.3][OUT] ’ $target->[2]{$mode} ’ did not eval into defined data
2009-06-06 17:48:20, Rateup WARNING: /usr/bin/rateup Can’t remove 10.0.7.3.old updating log file
2009-06-06 17:48:20: ERROR: Target[10.0.7.4][IN] ’ $target->[3]{$mode} ’ did not eval into defined data
2009-06-06 17:48:20: ERROR: Target[10.0.7.4][OUT] ’ $target->[3]{$mode} ’ did not eval into defined data
2009-06-06 17:48:20, Rateup WARNING: /usr/bin/rateup Can’t remove 10.0.7.4.old updating log file
In half an hour I runned it another time and got a fewer texts:
oot@ubuntu:/home/user# env LANG=C mrtg /home/user/mrtg.cfg
SNMP Error:
no response received
SNMPv1_Session (remote host: “10.0.7.10” [10.0.7.10].161)
community: "public"
request ID: 942111477
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/share/perl5/SNMP_util.pm line 492
SNMPGET Problem for ifInOctets.1 ifOutOctets.1 sysUptime sysName on [email protected]::::::v4only
at /usr/bin/mrtg line 2207
2009-06-06 18:08:03: WARNING: skipping because at least the query for ifInOctets.1 on 10.0.7.10 did not succeed
2009-06-06 18:08:03: WARNING: no data for ifInOctets&ifOutOctets:[email protected]. Skipping further queries for Host 10.0.7.10 in this round.
2009-06-06 18:08:13: ERROR: Target[10.0.7.1][IN] ’ $target->[0]{$mode} ’ did not eval into defined data
2009-06-06 18:08:13: ERROR: Target[10.0.7.1][OUT] ’ $target->[0]{$mode} ’ did not eval into defined data
2009-06-06 18:08:13: ERROR: Target[10.0.7.2][IN] ’ $target->[1]{$mode} ’ did not eval into defined data
2009-06-06 18:08:13: ERROR: Target[10.0.7.2][OUT] ’ $target->[1]{$mode} ’ did not eval into defined data
2009-06-06 18:08:13: ERROR: Target[10.0.7.3][IN] ’ $target->[2]{$mode} ’ did not eval into defined data
2009-06-06 18:08:13: ERROR: Target[10.0.7.3][OUT] ’ $target->[2]{$mode} ’ did not eval into defined data
2009-06-06 18:08:13: ERROR: Target[10.0.7.4][IN] ’ $target->[3]{$mode} ’ did not eval into defined data
2009-06-06 18:08:13: ERROR: Target[10.0.7.4][OUT] ’ $target->[3]{$mode} ’ did not eval into defined data
Also a edited object config file in Nagios:
Monitor Port status via SNMP
define service{
use generic-service
host_name TrendNet
service_description Port 1 Link Status
check_command check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB
}
define service{
use generic-service
host_name TrendNet
service_description Port 2 Link Status
check_command check_snmp!-C public -o ifOperStatus.2 -r 1 -m RFC1213-MIB
}
define service{
use generic-service
host_name TrendNet
service_description Port 3 Link Status
check_command check_snmp!-C public -o ifOperStatus.3 -r 1 -m RFC1213-MIB
}
Monitor bandwidth via MRTG logs
define service{
use generic-service
host_name TrendNet
service_description Port 1 Bandwidth Usage
check_command check_local_mrtgtraf!/var/lib/mrtg/10.0.7.1.log!AVG!1000000,1000000!5000000,5000000!10
}
define service{
use generic-service
host_name TrendNet
service_description Port 2 Bandwidth Usage
check_command check_local_mrtgtraf!/var/lib/mrtg/10.0.7.2.log!AVG!1000000,1000000!5000000,5000000!10
}
define service{
use generic-service
host_name TrendNet
service_description Port 3 Bandwidth Usage
check_command check_local_mrtgtraf!/var/lib/mrtg/10.0.7.3.log!AVG!1000000,1000000!5000000,5000000!10
Nagios shows in browser the next:
PING - OK 06-06-2009 18:28:35 7d 3h 21m 36s 1/3 PING OK - Packet loss = 0%, RTA = 2.44 ms
Port 1 Bandwidth Usage - WARNING 06-06-2009 18:29:48 2d 0h 50m 42s 3/3 MRTG data has expired (20 minutes old)
Port 1 Link Status - UNKNOWN 06-06-2009 18:31:02 2d 16h 35m 10s 3/3 SNMP problem - No data received from host
Port 2 Bandwidth Usage - WARNING 06-06-2009 18:32:15 2d 0h 48m 15s 3/3 MRTG data has expired (23 minutes old)
Port 2 Link Status - UNKNOWN 06-06-2009 18:23:29 2d 16h 32m 43s 3/3 SNMP problem - No data received from host
Port 3 Bandwidth Usage - WARNING 06-06-2009 18:24:42 2d 0h 45m 48s 3/3 MRTG data has expired (15 minutes old)
Port 3 Link Status - UNKNOWN 06-06-2009 18:30:11 2d 19h 42m 41s 3/3 SNMP problem - No data received from host
Uptime - UNKNOWN 06-06-2009 18:27:24 2d 16h 38m 48s 3/3 SNMP problem - No data received from host
What is wrong? Why i see SNMP and MRTG problems?