Re: [Nagios-users] simple chech using snmp

2006-10-02 Thread Tom Brown

>> any ideas or am i being dumb?
> You're not dumb... it's my script that's forcing you to use "-v 2c".  
> Just switch it over to "-v 1" and you should be fine.
> 
> I really should make that a config parameter at the top of the  
> script, since different people use different SNMP versions...

i had spotted that BUT i overlooked the community! I may make that a 
variable. Anyway

# ./retrieve_custom_snmp -H  -o 1.3.6.1.4.1.2021.57
CHASSIS: CRITICAL [ SCSI A external termination is Critical (3.374 V) ]

thanks for your help this is now working fine

-
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@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


Re: [Nagios-users] simple chech using snmp

2006-10-02 Thread Thomas Sluyter
> any ideas or am i being dumb?
You're not dumb... it's my script that's forcing you to use "-v 2c".  
Just switch it over to "-v 1" and you should be fine.

I really should make that a config parameter at the top of the  
script, since different people use different SNMP versions...


-
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@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


Re: [Nagios-users] simple chech using snmp

2006-10-02 Thread Tom Brown
Thomas Sluyter wrote:
> Right then... Clean slate for this e-mail...
> 
> I've set up my snmpd.conf to include the following.
> 
>   exec .1.3.6.1.4.1.6886.4.1.4 check_d_root /usr/local/nagios/libexec/ 
> check_disk -w 15 -c 5 -p /
> 
> SNMPWalking through that gives me:
> 
>   $ snmpwalk -v 2c -c management localhost .1.3.6.1.4.1.6886
>   SNMPv2-SMI::enterprises.6886.4.1.4.1.1 = INTEGER: 1
>   SNMPv2-SMI::enterprises.6886.4.1.4.2.1 = STRING: "check_d_root"
>   SNMPv2-SMI::enterprises.6886.4.1.4.3.1 = STRING: "/usr/local/nagios/ 
> libexec/check_disk -w 15 -c 5 -p /"
>   SNMPv2-SMI::enterprises.6886.4.1.4.100.1 = INTEGER: 0
>   SNMPv2-SMI::enterprises.6886.4.1.4.101.1 = STRING: "DISK OK - free  
> space: / 29707 MB (90%);| /=3409MB;33100;33110;0;33115"
>   SNMPv2-SMI::enterprises.6886.4.1.4.102.1 = INTEGER: 0
> 
> Now, trying it with the -Ovq flag:
> 
>   $ snmpwalk -Ovq -v 2c -c management localhost .1.3.6.1.4.1.6886
>   1
>   "check_d_root"
>   "/usr/local/nagios/libexec/check_disk -w 15 -c 5 -p /"
>   0
>   "DISK OK - free space: / 29707 MB (90%);| /=3409MB;33100;33110;0;33115"
>   0
> 
> Which is quite a lot closer to what we want. So I modify the two  
> snmpwalk commands in retrieve_custom_snmp. And I've made a boatload  
> of other fixes. I cannot believe how many mistakes I left in there : 
> ( Should be a lot better now... Anywho, running the script now  
> results in:
> 
>   $ ./retrieve_custom_snmp -H localhost -o .1.3.6.1.4.1.6886.4.1.4
>   DISK OK - free space: / 29705 MB (90%);| /=3410MB;33100;33110;0;33115
>   $ echo $?
>   0
> 
> Stuff that I had gotten wrong? I've already forgotten some things,  
> but here's the more notable stuff.
>   * No sed to strip quote from the output string.
>   * Had the wrong OID for the exit code. Used 100.0 (as indicated by  
> the man-pages), as opposed to 100.1.
>   * Used snmpwalk instead of snmpget.
> 
> Things should be a lot better now. Care to retry? The latest version  
> is up on my site right now. I'll also upload it to the Exchange in a  
> few minutes.

no joy for me running with snmp v 1 though

# snmpwalk  -c  -v 1 -t 30 1.3.6.1.4.1.2021.57
UCD-SNMP-MIB::ucdavis.57.1.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.57.2.1 = STRING: "/usr/local/bin/perl"
UCD-SNMP-MIB::ucdavis.57.3.1 = STRING: 
"/opt/nagios/libexec/check_om_chassis.pl"
UCD-SNMP-MIB::ucdavis.57.100.1 = INTEGER: 2
UCD-SNMP-MIB::ucdavis.57.101.1 = STRING: "CHASSIS: CRITICAL [ SCSI A 
external termination is Critical (3.346 V) ]"
UCD-SNMP-MIB::ucdavis.57.102.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.57.103.1 = ""

# ./retrieve_custom_snmp -H  -o 1.3.6.1.4.1.2021.57
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: UCD-SNMP-MIB::ucdavis.57.100.1

Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: UCD-SNMP-MIB::ucdavis.57.101.1

any ideas or am i being dumb?

thanks


-
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@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


Re: [Nagios-users] simple chech using snmp

2006-10-02 Thread Robert Hajime Lanning


> Right then... Clean slate for this e-mail...
>
> I've set up my snmpd.conf to include the following.
>
>   exec .1.3.6.1.4.1.6886.4.1.4 check_d_root /usr/local/nagios/libexec/
> check_disk -w 15 -c 5 -p /
>
> SNMPWalking through that gives me:
>
>   $ snmpwalk -v 2c -c management localhost .1.3.6.1.4.1.6886
>   SNMPv2-SMI::enterprises.6886.4.1.4.1.1 = INTEGER: 1
>   SNMPv2-SMI::enterprises.6886.4.1.4.2.1 = STRING: "check_d_root"
>   SNMPv2-SMI::enterprises.6886.4.1.4.3.1 = STRING: "/usr/local/nagios/
> libexec/check_disk -w 15 -c 5 -p /"
>   SNMPv2-SMI::enterprises.6886.4.1.4.100.1 = INTEGER: 0
>   SNMPv2-SMI::enterprises.6886.4.1.4.101.1 = STRING: "DISK OK - free
> space: / 29707 MB (90%);| /=3409MB;33100;33110;0;33115"
>   SNMPv2-SMI::enterprises.6886.4.1.4.102.1 = INTEGER: 0
>

Or, since you are using NET-SNMP, things like FS utilization checks
are really easy.

http://lanning.cc/custom_plugins/check_snmp_fsutil

This way I touch the monitored systems as little as possible.
There are even real good optimizations if you use ePN with caching.
You can edit p1.pl to load all the SNMP MIBs at start, instead of
each plugin execution.

-- 
And, did Guloka think the Ulus were too ugly to save?
 -Centauri


-
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@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


Re: [Nagios-users] simple chech using snmp

2006-10-02 Thread Thomas Sluyter
Right then... Clean slate for this e-mail...

I've set up my snmpd.conf to include the following.

exec .1.3.6.1.4.1.6886.4.1.4 check_d_root /usr/local/nagios/libexec/ 
check_disk -w 15 -c 5 -p /

SNMPWalking through that gives me:

$ snmpwalk -v 2c -c management localhost .1.3.6.1.4.1.6886
SNMPv2-SMI::enterprises.6886.4.1.4.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.6886.4.1.4.2.1 = STRING: "check_d_root"
SNMPv2-SMI::enterprises.6886.4.1.4.3.1 = STRING: "/usr/local/nagios/ 
libexec/check_disk -w 15 -c 5 -p /"
SNMPv2-SMI::enterprises.6886.4.1.4.100.1 = INTEGER: 0
SNMPv2-SMI::enterprises.6886.4.1.4.101.1 = STRING: "DISK OK - free  
space: / 29707 MB (90%);| /=3409MB;33100;33110;0;33115"
SNMPv2-SMI::enterprises.6886.4.1.4.102.1 = INTEGER: 0

Now, trying it with the -Ovq flag:

$ snmpwalk -Ovq -v 2c -c management localhost .1.3.6.1.4.1.6886
1
"check_d_root"
"/usr/local/nagios/libexec/check_disk -w 15 -c 5 -p /"
0
"DISK OK - free space: / 29707 MB (90%);| /=3409MB;33100;33110;0;33115"
0

Which is quite a lot closer to what we want. So I modify the two  
snmpwalk commands in retrieve_custom_snmp. And I've made a boatload  
of other fixes. I cannot believe how many mistakes I left in there : 
( Should be a lot better now... Anywho, running the script now  
results in:

$ ./retrieve_custom_snmp -H localhost -o .1.3.6.1.4.1.6886.4.1.4
DISK OK - free space: / 29705 MB (90%);| /=3410MB;33100;33110;0;33115
$ echo $?
0

Stuff that I had gotten wrong? I've already forgotten some things,  
but here's the more notable stuff.
* No sed to strip quote from the output string.
* Had the wrong OID for the exit code. Used 100.0 (as indicated by  
the man-pages), as opposed to 100.1.
* Used snmpwalk instead of snmpget.

Things should be a lot better now. Care to retry? The latest version  
is up on my site right now. I'll also upload it to the Exchange in a  
few minutes.

Cheers!


Thomas

-
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@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


Re: [Nagios-users] simple chech using snmp

2006-10-02 Thread Andreas Ericsson
Thomas Sluyter wrote:
> Yay, debugging! \o/
> 
> Could be handy if we move this off-list, unless no-one objects to us  
> handling this through the list.
> 
> 
>>> bha! end of the script now looks like this
>>>
>>> ### FINALLY... RETRIEVING THE VALUES ###
>>>
>>> EXITCODE=`$SNMPWALK -v 1 -c $COMMUNITY $HOST $STATUS`
>>> [ $DEBUG -gt 0 ] && echo "Retrieve exit code is $EXITCODE" >>  
>>> $DEBUGFILE
>>>
>>> OUTPUT=`$SNMPWALK -Ovq -v 1 -c $COMMUNITY $HOST $STRING`
>>> [ $DEBUG -gt 0 ] && echo "Retrieve status message is: $OUTPUT" >>
>>> $DEBUGFILE
>>>
>>> if [ $EXITCODE -eq 0 ]; then
>>>echo "$OUTPUT" | grep -v CRITICAL
>>>[ $? -eq 1 ] && EXITCODE=2
>>> fi
>>>
>>> echo $OUTPUT
>>> exit $EXITCODE
>>>
>>> but when it runs i get this
>>>
>>> ../libexec/retrieve_custom_snmp: line 84: [: -eq: unary operator  
>>> expected
>>> "CRITICAL emcpowera has 2 dead, 2 alive"
>>>
>> Urgh. My bad. What does EXITCODE contain when you run it in debug  
>> mode?
> 
> It should contain the exact same value it contains when not running  
> in debug mode: the exit code for the Nagios script being run through  
> SNMP exec.
> 

Yes, ofc, or we'd have a Heisenbug :)

What I meant was that it doesn't seem to be a numerical value. If I look 
at it I can see that it may very well be a textual representation, so 
perhaps we just have a clash in nomenclature.

> Could you tell me what exactly is contained on line 84 in your case?  
> Because in the version of the script up on my website, line 84 is  
> part of the Nagios "help" text.
> 
> I think I -should- look into the whole "-Ovq" bit a little bit  
> though. I think the $EXITCODE may benefit from this as well...
> 

Ah, that'd be it. I'm guessing the current output is expected to look 
something like this:

oid.some.more.of.the.oid = INTEGER: $REAL_EXITCODE

which is indeed numerical, but with a lot of junk in front of it. -Ovq 
would indeed help for this.

> If I find some time this afternoon, I'll start digging...
> 
> 
>> (on a side-note, whoever names a variable containing textual output  
>> "EXITCODE" should be shot)
> 
> Yes, that would be me thank you... What kind of gun would you prefer?  
> I would like to smoke a pipe before being executed, though. Mind?
> 

Not at all. If you come to sweden I'll buy you a whiskey to go along 
with that smoke. A water squirt gun to put it out when you're done 
sounds about right ;-)

> But before you pull that trigger, would you please go back just a wee  
> a bit and read my docu on what $EXITCODE contains? Why yes, it -does-  
> in fact contain the exit code of the Nagios script that was run on  
> the client side! OMG! Let me quote the bit in question:
> 
> # Output:
> # The exit code is the exit code retrieved from OID.100.0.
> # The output string is the string retrieved from OID.101.1.
> 
> /me puts on a blind fold.
> 
> Any suggestions for a variable name change are more than welcome. And  
> I guess I -could- elaborate the docu a bit more. Expect a newer  
> version, some time this afternoon.
> 

EXITCODE works fine for me. As for the docu-change, it shouldn't be 
necessary assuming either -Ovq or some sed magic removes all the cruft 
that's *not*, in fact, the exit-code.

>>> ho hum - enjoy the beer
>>>
>> Good plan. Working on it ;-)
> 
> Right about now, I'm wishing I had a nice, cold bottle of "Lambiek  
> Kriek" in my desk drawer.
> 

 Never tried that. Where's it from? 

-- 
Andreas Ericsson   [EMAIL PROTECTED]
OP5 AB www.op5.se
Tel: +46 8-230225  Fax: +46 8-230231

-
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@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


Re: [Nagios-users] simple chech using snmp

2006-10-02 Thread Thomas Sluyter
Yay, debugging! \o/

Could be handy if we move this off-list, unless no-one objects to us  
handling this through the list.


>> bha! end of the script now looks like this
>>
>> ### FINALLY... RETRIEVING THE VALUES ###
>>
>> EXITCODE=`$SNMPWALK -v 1 -c $COMMUNITY $HOST $STATUS`
>> [ $DEBUG -gt 0 ] && echo "Retrieve exit code is $EXITCODE" >>  
>> $DEBUGFILE
>>
>> OUTPUT=`$SNMPWALK -Ovq -v 1 -c $COMMUNITY $HOST $STRING`
>> [ $DEBUG -gt 0 ] && echo "Retrieve status message is: $OUTPUT" >>
>> $DEBUGFILE
>>
>> if [ $EXITCODE -eq 0 ]; then
>>echo "$OUTPUT" | grep -v CRITICAL
>>[ $? -eq 1 ] && EXITCODE=2
>> fi
>>
>> echo $OUTPUT
>> exit $EXITCODE
>>
>> but when it runs i get this
>>
>> ../libexec/retrieve_custom_snmp: line 84: [: -eq: unary operator  
>> expected
>> "CRITICAL emcpowera has 2 dead, 2 alive"
>>
>
> Urgh. My bad. What does EXITCODE contain when you run it in debug  
> mode?

It should contain the exact same value it contains when not running  
in debug mode: the exit code for the Nagios script being run through  
SNMP exec.

Could you tell me what exactly is contained on line 84 in your case?  
Because in the version of the script up on my website, line 84 is  
part of the Nagios "help" text.

I think I -should- look into the whole "-Ovq" bit a little bit  
though. I think the $EXITCODE may benefit from this as well...

If I find some time this afternoon, I'll start digging...


> (on a side-note, whoever names a variable containing textual output  
> "EXITCODE" should be shot)

Yes, that would be me thank you... What kind of gun would you prefer?  
I would like to smoke a pipe before being executed, though. Mind?

But before you pull that trigger, would you please go back just a wee  
a bit and read my docu on what $EXITCODE contains? Why yes, it -does-  
in fact contain the exit code of the Nagios script that was run on  
the client side! OMG! Let me quote the bit in question:

# Output:
# The exit code is the exit code retrieved from OID.100.0.
# The output string is the string retrieved from OID.101.1.

/me puts on a blind fold.

Any suggestions for a variable name change are more than welcome. And  
I guess I -could- elaborate the docu a bit more. Expect a newer  
version, some time this afternoon.

>> ho hum - enjoy the beer
>>
> Good plan. Working on it ;-)

Right about now, I'm wishing I had a nice, cold bottle of "Lambiek  
Kriek" in my desk drawer.

Cheers,


Thomas



-
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@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


Re: [Nagios-users] simple chech using snmp

2006-10-02 Thread Andreas Ericsson
Tom Brown wrote:
> 
>>
>> Add the following lines before the "echo $OUTPUT" line:
>>
>> if [ $EXITCODE -eq 0 ]; then
>> echo "$OUTPUT" | grep -v CRITICAL
>> [ $? -eq 1 ] && EXITCODE=2
>> fi
>>
>> Totally untested, but should work just dandy.
>>
>> I'm off to drink an awe inspiring amount of beer and other 
>> alcohol-based beverages now, so won't see any replies until monday.
>>
> 
> bha! end of the script now looks like this
> 
> ### FINALLY... RETRIEVING THE VALUES ###
> 
> EXITCODE=`$SNMPWALK -v 1 -c $COMMUNITY $HOST $STATUS`
> [ $DEBUG -gt 0 ] && echo "Retrieve exit code is $EXITCODE" >> $DEBUGFILE
> 
> OUTPUT=`$SNMPWALK -Ovq -v 1 -c $COMMUNITY $HOST $STRING`
> [ $DEBUG -gt 0 ] && echo "Retrieve status message is: $OUTPUT" >> 
> $DEBUGFILE
> 
> if [ $EXITCODE -eq 0 ]; then
>echo "$OUTPUT" | grep -v CRITICAL
>[ $? -eq 1 ] && EXITCODE=2
> fi
> 
> echo $OUTPUT
> exit $EXITCODE
> 
> but when it runs i get this
> 
> ../libexec/retrieve_custom_snmp: line 84: [: -eq: unary operator expected
> "CRITICAL emcpowera has 2 dead, 2 alive"
> 

Urgh. My bad. What does EXITCODE contain when you run it in debug mode?

(on a side-note, whoever names a variable containing textual output 
"EXITCODE" should be shot)

> ho hum - enjoy the beer
> 

Good plan. Working on it ;-)

-- 
Andreas Ericsson   [EMAIL PROTECTED]
OP5 AB www.op5.se
Tel: +46 8-230225  Fax: +46 8-230231

-
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@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


Re: [Nagios-users] simple chech using snmp

2006-09-29 Thread Thomas Sluyter
On 29 Sep, 2006, at 18:11, Andreas Ericsson wrote:

>> but it there a way to remove the "UCD-SNMP-MIB::ucdavis.55.101.1 =
>> STRING: " so i just see the text of the string?
>>
>
> to whatever command you're running it should work pretty ok, although
> with decently recent tools you should also be able to pass -Ovq to
> snmpget and achieve pretty much the same result with less overhead.

And since snmpget is -exactly- what I'm using inside the script, you  
can indeed easily add these parameters to the command. :)

All sorted.

You know? I think I might put this into my version as well! Could be  
handy, really.

-
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@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


Re: [Nagios-users] simple chech using snmp

2006-09-29 Thread Andreas Ericsson
Tom Brown wrote:
>> thanks for this - This is exactly what i am after however i have an issue...
>>
>> when i run it after making a couple of mode for community string and 
>> snmp version etc i get this
>>
>> # ./retrieve_custom_snmp -H 192.168.12.176 -o 1.3.6.1.4.1.2021.56
>>
>> and thats it - no output. if i enable debug i get this
>>
>> # cat /tmp/foobar
>> Retrieve exit code is
>> Retrieve status message is:
>>
>> ie nothing - can you offer any assistance here?
>>
> 
> OK better...
> 
> # ./retrieve_custom_snmp -H 192.168.12.176 -o .1.3.6.1.4.1.2021.55
> UCD-SNMP-MIB::ucdavis.55.101.1 = STRING: "CRITICAL emcpowera, 2 dead, 2 
> alive, possible LUN tresspass or HBA failure"
> 
> but it there a way to remove the "UCD-SNMP-MIB::ucdavis.55.101.1 = 
> STRING: " so i just see the text of the string?
> 

sed be thy friend. I didn't catch the beginning of the discussion, but 
if you append
| sed 's/.*STRING: //'

to whatever command you're running it should work pretty ok, although 
with decently recent tools you should also be able to pass -Ovq to 
snmpget and achieve pretty much the same result with less overhead.

-- 
Andreas Ericsson   [EMAIL PROTECTED]
OP5 AB www.op5.se
Tel: +46 8-230225  Fax: +46 8-230231

-
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@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


Re: [Nagios-users] simple chech using snmp

2006-09-29 Thread Tom Brown

> thanks for this - This is exactly what i am after however i have an issue...
> 
> when i run it after making a couple of mode for community string and 
> snmp version etc i get this
> 
> # ./retrieve_custom_snmp -H 192.168.12.176 -o 1.3.6.1.4.1.2021.56
> 
> and thats it - no output. if i enable debug i get this
> 
> # cat /tmp/foobar
> Retrieve exit code is
> Retrieve status message is:
> 
> ie nothing - can you offer any assistance here?
> 

OK better...

# ./retrieve_custom_snmp -H 192.168.12.176 -o .1.3.6.1.4.1.2021.55
UCD-SNMP-MIB::ucdavis.55.101.1 = STRING: "CRITICAL emcpowera, 2 dead, 2 
alive, possible LUN tresspass or HBA failure"

but it there a way to remove the "UCD-SNMP-MIB::ucdavis.55.101.1 = 
STRING: " so i just see the text of the string?

thanks

-
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@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


Re: [Nagios-users] simple chech using snmp

2006-09-29 Thread Tom Brown

thanks for this - This is exactly what i am after however i have an issue...

when i run it after making a couple of mode for community string and 
snmp version etc i get this

# ./retrieve_custom_snmp -H 192.168.12.176 -o 1.3.6.1.4.1.2021.56

and thats it - no output. if i enable debug i get this

# cat /tmp/foobar
Retrieve exit code is
Retrieve status message is:

ie nothing - can you offer any assistance here?

thanks

> I wrote a script for this a few weeks back.
> 
> http://www.kilala.nl/Sysadmin/retrieve_custom_snmp.php
> 
> It's also available from the Exchange, if you like :)
> 
> 
> On 29 Sep, 2006, at 15:10, Tom Brown wrote:
> 
>> Hi
>>
>> I have added some things to my snmp config that i would normally use
>> nrpe for so that i can do a...
>>
>> snmpwalk host -v 1 -c community OID_string
>>
>> and get the desired response - does anyone know how i can construct a
>> plugin that would execute that line and then parse the returned  
>> value? I
>> have tried to deconstruct another snmp plugin but got very confused!
>>
>> thanks
>>
>> -- 
>> ---
>> 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@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
> 
> 
> -
> 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@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


-
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@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


Re: [Nagios-users] simple chech using snmp

2006-09-29 Thread Thomas Sluyter
I wrote a script for this a few weeks back.

http://www.kilala.nl/Sysadmin/retrieve_custom_snmp.php

It's also available from the Exchange, if you like :)


On 29 Sep, 2006, at 15:10, Tom Brown wrote:

> Hi
>
> I have added some things to my snmp config that i would normally use
> nrpe for so that i can do a...
>
> snmpwalk host -v 1 -c community OID_string
>
> and get the desired response - does anyone know how i can construct a
> plugin that would execute that line and then parse the returned  
> value? I
> have tried to deconstruct another snmp plugin but got very confused!
>
> thanks
>
> -- 
> ---
> 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@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


-
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@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


Re: [Nagios-users] simple chech using snmp

2006-09-29 Thread Ugo Bellavance
Tom Brown wrote:
> Hi
> 
> I have added some things to my snmp config that i would normally use 
> nrpe for so that i can do a...
> 
> snmpwalk host -v 1 -c community OID_string
> 
> and get the desired response - does anyone know how i can construct a 
> plugin that would execute that line and then parse the returned value? I 
> have tried to deconstruct another snmp plugin but got very confused!
> 
> thanks

Did you try going to nagiosexhange.org and see what they've got?  They 
probably have exactly what you want, and if not, there are probably 
similar plugins to help you develop yours.

Ugo


-
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@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


[Nagios-users] simple chech using snmp

2006-09-29 Thread Tom Brown
Hi

I have added some things to my snmp config that i would normally use 
nrpe for so that i can do a...

snmpwalk host -v 1 -c community OID_string

and get the desired response - does anyone know how i can construct a 
plugin that would execute that line and then parse the returned value? I 
have tried to deconstruct another snmp plugin but got very confused!

thanks

-
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@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