Using check_snmp_int.pl to query Windows networkinterface

Patrick Proy nagios-user at proy.org
Mon Dec 11 11:56:47 CET 2006


Hi,
 
This NULL problem should have been corrected in version 1.4.1 and later. Try
updating your version : 
http://www.manubulon.com/nagios/check_snmp_int.pl

Regards,

Patrick
http://www.manubulon.com/nagios/

________________________________

De : Peter Edmonds [mailto:termx23 at gmail.com] 
Envoyé : lundi 11 décembre 2006 05:39
À : Patrick Proy
Cc : nagios-users at lists.sourceforge.net
Objet : Re: [Nagios-users] Using check_snmp_int.pl to query Windows
networkinterface


On 12/11/06, Patrick Proy < nagios-user at proy.org
<mailto:nagios-user at proy.org> > wrote: 

	Hi,
	
	Replace line 562 in the script with :
	
	$descr[$i] =~ s/'\/\(\)/_/g;



Hi Patrick,

I changed  check_snmp_int.pl at line 562 as suggested - no change in
behaviour unfortunately. Looking at the line above it should work. 

I have resorted to using sed and tr like this

check_snmp_int.pl -H $HOSTADDRESS$ -C public -n $ARG1$ -B -f -w 0,0 -c 0,0 |
sed 's/\//_/g' | sed 's/\///g' | sed 's/'\('R'\)'//g' | sed 's/Intel
PRO_1000 CT Network Connection*/eth0/g' | tr -d '\0'

For some reason, the output from check_snmp_int.pl contained NULL characters
(HEX 00) like this 

eth0NULL:UP:1 UP: OK | 'eth0NULL_in_octet'=3167298692c
'eth0NULL_out_octet'=2854496598c 

The NULLs caused the output to be truncated. I think this was a product of
the SNMP description, not check_snmp_int.pl itself. The NULLS only occur
against Windows machines.Doing 

check_snmp_int.pl -H $HOSTADDRESS$ -C public -n "Intel\(R\) PRO\/1000 CT*"
-B -f -w 0,0 -c 0,0 | od -t c 

generated this

0000000   I   n   t   e   l   (   R   )       P   R   O   /   1   0   0
0000020   0       C   T       N   e   t   w   o   r   k       C   o   n
0000040   n   e   c   t   i   o   n  \0   :   U   P   :   1       U   P 
0000060   :       O   K       |       '   I   n   t   e   l   (   R   )
0000100       P   R   O   /   1   0   0   0       C   T       N   e   t
0000120   w   o   r   k       C   o   n   n   e   c   t   i   o   n  \0 
0000140   _   i   n   _   o   c   t   e   t   '   =   3   3   9   4   9
0000160   0   0   9   4   2   c       '   I   n   t   e   l   (   R   )
0000200       P   R   O   /   1   0   0   0       C   T       N   e   t 
0000220   w   o   r   k       C   o   n   n   e   c   t   i   o   n  \0
0000240   _   o   u   t   _   o   c   t   e   t   '   =   3   0   2   0
0000260   2   2   6   1   7   4   c  \n
0000270


The NULLS are \0 in the above output. Stupid Windows. The performance data
now displays properly. Hope this help someone else. 


Peter



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list