Using check_snmp_int.pl to query Windows networkinterface

Peter Edmonds termx23 at gmail.com
Mon Dec 11 05:39:15 CET 2006


On 12/11/06, Patrick Proy <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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20061211/cf8b68c1/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
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
-------------- next part --------------
_______________________________________________
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