falc410
Profi
Beiträge: 638
Geburtstag: 14.02.1983 (28)
Geschlecht: Männlich
Wohnort: Germany - Munich
Beruf: Student - Computer Science
Anzahl Nagios-Server: 2
Hobbys: learning C# & XNA - Gamedesign, iPhone Programming
Nagios-Version(en): 3.0.6
Verteiltes Monitoring: Nein
Redundantes Monitoring: Ja
Anzahl-Hosts: 300
Anzahl Services: 2000
Betriebssystem(e): RHEL5
Plugin-Version(en): 1.4.12
NagVis-Version: 1.5.1
NDO-Version: 1.4b7
Perfparse-Version: PNP 0.6.2
Sonstige Addon's: 2 Node Cluster again with Heartbeat 2.1 & DRBD 8 / Munin 1.4
Quoted
[root checks]# ./check_snmp -H 10.0.0.22 -C public -c 215:235 -o mib-2.33.1.3.3.1.3.3 -l 'Input Voltage L3:' -u Volt -v
/usr/bin/snmpget -t 1 -r 5 -m ALL -v 1 -c public 10.0.0.22:161 mib-2.33.1.3.3.1.3.3
UPS-MIB::upsInputVoltage.3 = INTEGER: 222 RMS Volts
Input Voltage L3: OK - 222 Volt | UPS-MIB::upsInputVoltage.3=222
[root checks]# ./check_snmp -H 10.0.0.22 -o upsInputVoltage.3 -l 'Input Voltage L3:' -v
/usr/bin/snmpget -t 1 -r 5 -m ALL -v 1 -c public 10.0.0.22:161 upsInputVoltage.3
UPS-MIB::upsInputVoltage.3 = INTEGER: 223 RMS Volts
Input Voltage L3: OK - 223 RMS Volts |
Quoted
check_snmp v2021 (nagios-plugins 1.4.13)
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »falc410« (21.09.2011, 14:35)
Beiträge: 15 201
Wohnort: Kassel
Beruf: Sysadmin SAP / Linux / AIX
Anzahl Nagios-Server: 2
Hobbys: Motorrad fahren, wenns die Zeit erlaubt :-)
Nagios-Version(en): 3.2.1
Icinga-Version(en): ---
Verteiltes Monitoring: Nein
Redundantes Monitoring: Nein
Anzahl-Hosts: 310
Anzahl Services: 4500
Betriebssystem(e): Debian 5.0 Lenny
Plugin-Version(en): 1.4.x
NagVis-Version: 1.4.1
NDO-Version: ---
IDO-Version: ---
Perfparse-Version: ---
Sonstige Addon's: SNMPTT, NagTrap, NagVis 1.4.5, check_mk, PNP-0.6.x. Thruk
2
21.09.2011, 14:11
falc410
Profi
Beiträge: 638
Geburtstag: 14.02.1983 (28)
Geschlecht: Männlich
Wohnort: Germany - Munich
Beruf: Student - Computer Science
Anzahl Nagios-Server: 2
Hobbys: learning C# & XNA - Gamedesign, iPhone Programming
Nagios-Version(en): 3.0.6
Verteiltes Monitoring: Nein
Redundantes Monitoring: Ja
Anzahl-Hosts: 300
Anzahl Services: 2000
Betriebssystem(e): RHEL5
Plugin-Version(en): 1.4.12
NagVis-Version: 1.5.1
NDO-Version: 1.4b7
Perfparse-Version: PNP 0.6.2
Sonstige Addon's: 2 Node Cluster again with Heartbeat 2.1 & DRBD 8 / Munin 1.4
Beiträge: 15 201
Wohnort: Kassel
Beruf: Sysadmin SAP / Linux / AIX
Anzahl Nagios-Server: 2
Hobbys: Motorrad fahren, wenns die Zeit erlaubt :-)
Nagios-Version(en): 3.2.1
Icinga-Version(en): ---
Verteiltes Monitoring: Nein
Redundantes Monitoring: Nein
Anzahl-Hosts: 310
Anzahl Services: 4500
Betriebssystem(e): Debian 5.0 Lenny
Plugin-Version(en): 1.4.x
NagVis-Version: 1.4.1
NDO-Version: ---
IDO-Version: ---
Perfparse-Version: ---
Sonstige Addon's: SNMPTT, NagTrap, NagVis 1.4.5, check_mk, PNP-0.6.x. Thruk
4
21.09.2011, 14:15
Beiträge: 1 688
Anzahl Nagios-Server: 2-5
Nagios-Version(en): 1-3
Verteiltes Monitoring: Nein
Redundantes Monitoring: Nein
Anzahl-Hosts: 80-200
Anzahl Services: 1400-2000
Betriebssystem(e): Linux
Plugin-Version(en): Whatever I can download, patch, or cobble together myself :-)
Sonstige Addon's: n2rrd, PNP, livestatus
5
21.09.2011, 14:15
Nein, der Grund ist, daß in Deinem zweiten Aufruf das "-c ..." fehlt. Nur wenn numerische Limits zu prüfen sind, parst check_snmp aus dem Rückgabewert "223 RMS Volts" extra nochmal die "223" 'raus und speichert sie in show - und nur wenn show schlußendlich numerisch ist, werden Performance-Daten draus gebaut.Also scheint check_snmp anders zu funktionieren je nachdem was ich bei -o angebe.
![]() |
Quellcode |
294 295 296 297 298 299 300 301 302 |
/* Process this block for integer comparisons */ if (thlds[i]->warning || thlds[i]->critical) { ptr = strpbrk (show, "0123456789"); if (ptr == NULL) die (STATE_UNKNOWN,_("No valid data returned")); response_value[i] = strtod (ptr, NULL); iresult = get_status(response_value[i], thlds[i]); asprintf (&show, conv, response_value[i]); } |
![]() |
Quellcode |
354 355 356 357 |
if (is_numeric(show)) { strncat(perfstr, oidname, sizeof(perfstr)-strlen(perfstr)-1); strncat(perfstr, "=", sizeof(perfstr)-strlen(perfstr)-1); strncat(perfstr, show, sizeof(perfstr)-strlen(perfstr)-1); |
Beiträge: 15 201
Wohnort: Kassel
Beruf: Sysadmin SAP / Linux / AIX
Anzahl Nagios-Server: 2
Hobbys: Motorrad fahren, wenns die Zeit erlaubt :-)
Nagios-Version(en): 3.2.1
Icinga-Version(en): ---
Verteiltes Monitoring: Nein
Redundantes Monitoring: Nein
Anzahl-Hosts: 310
Anzahl Services: 4500
Betriebssystem(e): Debian 5.0 Lenny
Plugin-Version(en): 1.4.x
NagVis-Version: 1.4.1
NDO-Version: ---
IDO-Version: ---
Perfparse-Version: ---
Sonstige Addon's: SNMPTT, NagTrap, NagVis 1.4.5, check_mk, PNP-0.6.x. Thruk
6
21.09.2011, 14:26
falc410
Profi
Beiträge: 638
Geburtstag: 14.02.1983 (28)
Geschlecht: Männlich
Wohnort: Germany - Munich
Beruf: Student - Computer Science
Anzahl Nagios-Server: 2
Hobbys: learning C# & XNA - Gamedesign, iPhone Programming
Nagios-Version(en): 3.0.6
Verteiltes Monitoring: Nein
Redundantes Monitoring: Ja
Anzahl-Hosts: 300
Anzahl Services: 2000
Betriebssystem(e): RHEL5
Plugin-Version(en): 1.4.12
NagVis-Version: 1.5.1
NDO-Version: 1.4b7
Perfparse-Version: PNP 0.6.2
Sonstige Addon's: 2 Node Cluster again with Heartbeat 2.1 & DRBD 8 / Munin 1.4
7
21.09.2011, 14:33
Quoted
[root checks]# ./check_snmp -H 10.0.0.22 -o upsInputVoltage.3 -l 'Input Voltage L3:'-c 215:235 -v
/usr/bin/snmpget -t 1 -r 5 -m ALL -v 1 -c public 10.0.0.22:161 upsInputVoltage.3
UPS-MIB::upsInputVoltage.3 = INTEGER: 226 RMS Volts
Input Voltage L3:-c OK - 226 RMS Volts |
Quoted
[root checks]# ./check_snmp -H 10.0.0.22 -c 215:235 -o upsInputVoltage.3 -l 'Input Voltage L3:' -v
/usr/bin/snmpget -t 1 -r 5 -m ALL -v 1 -c public 10.0.0.22:161 upsInputVoltage.3
UPS-MIB::upsInputVoltage.3 = INTEGER: 223 RMS Volts
Input Voltage L3: OK - 223 | UPS-MIB::upsInputVoltage.3=223
Beiträge: 1 688
Anzahl Nagios-Server: 2-5
Nagios-Version(en): 1-3
Verteiltes Monitoring: Nein
Redundantes Monitoring: Nein
Anzahl-Hosts: 80-200
Anzahl Services: 1400-2000
Betriebssystem(e): Linux
Plugin-Version(en): Whatever I can download, patch, or cobble together myself :-)
Sonstige Addon's: n2rrd, PNP, livestatus
8
21.09.2011, 16:49
Beiträge: 15 201
Wohnort: Kassel
Beruf: Sysadmin SAP / Linux / AIX
Anzahl Nagios-Server: 2
Hobbys: Motorrad fahren, wenns die Zeit erlaubt :-)
Nagios-Version(en): 3.2.1
Icinga-Version(en): ---
Verteiltes Monitoring: Nein
Redundantes Monitoring: Nein
Anzahl-Hosts: 310
Anzahl Services: 4500
Betriebssystem(e): Debian 5.0 Lenny
Plugin-Version(en): 1.4.x
NagVis-Version: 1.4.1
NDO-Version: ---
IDO-Version: ---
Perfparse-Version: ---
Sonstige Addon's: SNMPTT, NagTrap, NagVis 1.4.5, check_mk, PNP-0.6.x. Thruk
9
21.09.2011, 16:56
falc410
Profi
Beiträge: 638
Geburtstag: 14.02.1983 (28)
Geschlecht: Männlich
Wohnort: Germany - Munich
Beruf: Student - Computer Science
Anzahl Nagios-Server: 2
Hobbys: learning C# & XNA - Gamedesign, iPhone Programming
Nagios-Version(en): 3.0.6
Verteiltes Monitoring: Nein
Redundantes Monitoring: Ja
Anzahl-Hosts: 300
Anzahl Services: 2000
Betriebssystem(e): RHEL5
Plugin-Version(en): 1.4.12
NagVis-Version: 1.5.1
NDO-Version: 1.4b7
Perfparse-Version: PNP 0.6.2
Sonstige Addon's: 2 Node Cluster again with Heartbeat 2.1 & DRBD 8 / Munin 1.4
10
Gestern, 13:49
Quoted
command[ Input_Voltage_L2 ] = check_snmp -H $UPSIP$ -C public -c 215:235 -o mib-2.33.1.3.3.1.3.2 -l 'Input Voltage L2:' -u Volt
Quoted
Input_Voltage_L2::check_snmp::UPS-MIB_upsInputVoltage.2=231
Beiträge: 1 688
Anzahl Nagios-Server: 2-5
Nagios-Version(en): 1-3
Verteiltes Monitoring: Nein
Redundantes Monitoring: Nein
Anzahl-Hosts: 80-200
Anzahl Services: 1400-2000
Betriebssystem(e): Linux
Plugin-Version(en): Whatever I can download, patch, or cobble together myself :-)
Sonstige Addon's: n2rrd, PNP, livestatus
11
Gestern, 15:40
Nein und nein. Auch in der aktuellen 1.4.15 steht
Zitat von »falc410«
Kann ich die Range irgendwie so angeben das bei den Perf Daten auch noch die Schwellwerte mit ausgegeben werden
Geht das vielleicht erst mit einer neueren check_snmp Version?
![]() |
Quellcode |
1 |
/* Write perfdata with whatever can be parsed by strtod, if possible */ |