I have tried this<br><br>#!/bin/sh <br><br>$output=`/usr/local/nagios/libexec/check_snmp -H $1 -o $2`<br><br>if [ $output = 0 ]<br><br>echo "low paper"<br><br>if [ $output = 1 ]<br><br>echo "no Paper"<br>
<br>if [ $output = 2 ]<br><br>echo "low Toner"<br>.<br>.<br>.<br>exit ($value)<br><br>i get this errors :<br>../libexec/check_Xerox_Status: line 3: =SNMP: command not found<br>../libexec/check_Xerox_Status: line 65: syntax error near unexpected token `$value'
<br>../libexec/check_Xerox_Status: line 65: `exit ($value)'<br><br>I am totally walking blind there as i could say it is my first script, can you give a hand?<br><br>Thanks<br>and i get this error <br><div><span class="gmail_quote">
2006/2/8, Sumit Malhotra <<a href="mailto:smalhotra@dataarmor.net">smalhotra@dataarmor.net</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br><br><br> _____<br><br>From: <a href="mailto:nagios-users-admin@lists.sourceforge.net">nagios-users-admin@lists.sourceforge.net</a><br>[mailto:<a href="mailto:nagios-users-admin@lists.sourceforge.net">nagios-users-admin@lists.sourceforge.net
</a>] On Behalf Of Toto<br>Capuccino<br>Sent: Wednesday, February 08, 2006 2:52 PM<br>To: Nagios<br>Subject: [Nagios-users] Need pointer<br><br><br><br>Hi,<br><br>I need a pointer to do the following :<br>i am checking the staus of printers with check_snmp -H
x.x.x.x -o OID<br>the snmp check returns a value between 0 and 14 that corresponds to a state<br> Condition Bit #<br> lowPaper 0<br> noPaper 1<br> lowToner 2
<br> noToner 3<br> doorOpen 4<br> jammed 5<br> offline 6<br> serviceRequested 7<br> inputTrayMissing 8<br> outputTrayMissing 9
<br> markerSupplyMissing 10<br> outputNearFull 11<br> outputFull 12<br> inputTrayEmpty 13<br> overduePreventMaint 14<br><br>What i want to do is to make appear the value in the output of the check.
<br>How can i do that ?<br><br>Write a wrapper script which instead of returning OID in output returns the<br>State instead of NUMBERIC value.<br><br><br><br>The script could be like<br><br><br><br>#!/bin/sh<br><br>output= `/usr/bin/local/Nagios/check_snmp -H $1 -o $2`
<br><br><br><br>if [ $output = 0 ]<br><br>echo "lowpaper"<br><br>exit ($value)<br><br></blockquote></div><br><br clear="all"><br>-- <br>Le bon sens est la chose du monde la mieux partagée.