TrendNet 24 port 1gbps switch monitoring


#1

Hi! I am new in nagios. Please help me to setup correctly switch monitoring. I am getting the log like:

PING - OK 05-31-2009 17:01:29 0d 7h 50m 49s 1/3 PING OK - Packet loss = 0%, RTA = 2.46 ms
Port 1 Bandwidth Usage - UNKNOWN 05-31-2009 16:56:42 0d 7h 49m 36s 3/3 check_mrtgtraf: Unable to open MRTG log file
Port 1 Link Status - CRITICAL 05-31-2009 16:57:56 0d 7h 48m 22s 3/3 (Return code of 127 is out of bounds - plugin may be missing)
Port 2 Bandwidth Usage - UNKNOWN 05-31-2009 16:59:09 0d 7h 47m 9s 3/3 check_mrtgtraf: Unable to open MRTG log file
Port 2 Link Status - CRITICAL 05-31-2009 17:00:23 0d 7h 45m 55s 3/3 (Return code of 127 is out of bounds - plugin may be missing)
Port 3 Bandwidth Usage - UNKNOWN 05-31-2009 17:01:36 0d 7h 44m 42s 3/3 check_mrtgtraf: Unable to open MRTG log file
Port 3 Link Status - CRITICAL 05-31-2009 16:53:05 0d 7h 53m 13s 3/3 (Return code of 127 is out of bounds - plugin may be missing)
Uptime - CRITICAL 05-31-2009 16:54:18 0d 7h 52m 0s 3/3 (Return code of 127 is out of bounds - plugin may be missing)

And my config is like:

define host{
use generic-switch
host_name TrendNet
alias TrendNet 1Gbit switch
address 10.0.7.10
hostgroups switches
}

define service{
use generic-service
host_name TrendNet
service_description PING
check_command check_ping!200.0,20%!600.0,60%
normal_check_interval 5
retry_check_interval 1
}

define service{
use generic-service
host_name TrendNet
service_description Uptime
check_command check_snmp!-C public -o sysUpTime.0
}

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 2 -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 3 -m RFC1213-MIB
}

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.10_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.10_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.10_3.log!AVG!1000000,1000000!5000000,5000000!10
}


#2

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:public@10.0.7.10
MaxBytes[10.0.7.1]: 1250000
Title[10.0.7.1]: : ISA-Server

Target[10.0.7.2]: 2:public@10.0.7.10
MaxBytes[10.0.7.2]: 1250000
Title[10.0.7.2]: : VM-Server

Target[10.0.7.3]: 3:public@10.0.7.10
MaxBytes[10.0.7.3]: 1250000
Title[10.0.7.3]: : MIRI

Target[10.0.7.4]: 4:public@10.0.7.10
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 public@10.0.7.10::::::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:public@10.0.7.10. 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 public@10.0.7.10::::::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:public@10.0.7.10. 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?


#3

is snmp enabled on the switch? are you using the correct options?

this line:

has that “v4only” at the end which looks quite bad :slight_smile:

Luca


#4

I’ve found that my Trendnet TEG-240WS has no SNMP option. After updating the frameware it has appeared. After enabling it I saw beautifull records:

Port 3 Link Status - OK 06-08-2009 04:18:41 0d 6h 38m 49s 1/3 SNMP OK - up(1)
Uptime - OK 06-08-2009 04:19:55 0d 6h 37m 35s 1/3 SNMP OK - Timeticks: (851930) 2:21:59.30

MRTG updating i did via “crontab” task scheduler.

Thanks! :slight_smile: