I, for one, am against any use of check_by_ssh as it requires authorized keys, hence opening a security hole. All scripts can be executed thru snmp. Install it on your servers and use the exec directive to remotely execute the script. The output will return the last line and the exit code from the call, so the check_snmp plugin can work.<br>

NOTE: Unless snmp was already installed on your nagios server prior to installing nagios, you'll need to re-run the ./configure, make and make install commands for the plugins, so check_snmp will be compiled in.<br><br>

A simple line in your snmpd.conf file like the one below can be executed from the nagios server:<br><br><snip><br>exec checkrootpartition /usr/local/nagios/libexec/check_disk -w 1000 -c 500 -p / -u MB<br></snip><br>

<br>Subsequent exec directives can be added as well.<br><br>Of course, you'll need to copy the libexec directory over to the remote server (although it's not necessary, you can write your own scripts if you'd like) <br>

<br>All parameters will need to be on the line in the snmpd.conf file. Then write a little script on the nagios server to check it. Here's the contents of that script. It DOES require the community name be the same on both servers. In snmpd.conf, edit this line:<br>

<br>com2sec readonly  default         <community><br><br>and replace <community> with your made-up string<br><br><script snippet><br>#!/bin/bash<br>usage() {<br> echo "USAGE:  test_snmp <server> <snmp #>"<br>

 exit<br>}<br>if [ "$1" == "" ]<br> then<br>   usage<br>fi<br>if [ "$2" == "" ]<br> then<br>   usage<br>fi<br><br>/usr/local/nagios/libexec/check_snmp -t 7 -H $1 -C <community-string> -o enterprises.ucdavis.extTable.extEntry.extResult.$2,enterprises.ucdavis.extTable.extEntry.extOutput.$2 -w 0 -c 1<br>

<br></script snippet><br><br>Edit it so that it fits your environment, such as the path to check_snmp and the community string.<br><br>Now, name it test_snmp and run the script:<br>./test_snmp <servername> 1<br>

where 1 is the ordinal "exec" directive. exec directives in snmpd.conf are numbered as they appear in the file, so the first exec directive is accessed as "1", the second as "2" etc.<br><br>
<br>
<br><div class="gmail_quote">On Fri, Dec 5, 2008 at 10:55 AM, David Dyer-Bennet <span dir="ltr"><<a href="mailto:dd-b@dd-b.net" target="_blank">dd-b@dd-b.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

I'm running Nagios 2.10 (the Centos 5.2 packaged version).<br>
<br>
I want to do some small local checks on each of a bunch of real and<br>
virtual servers, and I really don't want to have to set up Nagios (even a<br>
minimal install) on each of them just to check uptime, load average, and<br>
disk space.  (Mostly I'm testing externally visible services on them.)<br>
<br>
The documentation on this plugin doesn't seem to tell me anything about<br>
what it does with the part of the command output it processes (I see that<br>
the -S and -E commands let me prune what command output it looks at).<br>
<br>
When I run it from the command line simply, I just get the output of the<br>
remote command (as if the plugin was just passing it through).  I see that<br>
I could cause it to produce errors based on how long it takes, but nothing<br>
about how to actually use the output.<br>
<br>
Then I see some tantalizing hints about "passive" mode, where it writes a<br>
file that seems to show it doing some parsing and making decisions based<br>
on the data (in the example).  But I can't get the example to produce a<br>
non-empty file from the command line.<br>
<br>
So I'm pretty sure I'm missing something about how to use this plugin in<br>
the first place, or what it's supposed to let me do, or some such.<br>
<br>
Or, if the answer to what I'm trying to do is some other approach<br>
entirely, I'd settle for enlightenment about that!<br>
<br>
Help?<br>
--<br>
David Dyer-Bennet, <a href="mailto:dd-b@dd-b.net" target="_blank">dd-b@dd-b.net</a>; <a href="http://dd-b.net/" target="_blank">http://dd-b.net/</a><br>
Snapshots: <a href="http://dd-b.net/dd-b/SnapshotAlbum/data/" target="_blank">http://dd-b.net/dd-b/SnapshotAlbum/data/</a><br>
Photos: <a href="http://dd-b.net/photography/gallery/" target="_blank">http://dd-b.net/photography/gallery/</a><br>
Dragaera: <a href="http://dragaera.info" target="_blank">http://dragaera.info</a><br>
<br>
<br>
------------------------------------------------------------------------------<br>
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.<br>
The future of the web can't happen without you.  Join us at MIX09 to help<br>
pave the way to the Next Web now. Learn more and register at<br>
<a href="http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/" target="_blank">http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/</a><br>
_______________________________________________<br>
Nagios-users mailing list<br>
<a href="mailto:Nagios-users@lists.sourceforge.net" target="_blank">Nagios-users@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>
::: Messages without supporting info will risk being sent to /dev/null<br>
</blockquote></div><br><br clear="all"><br>-- <br>Gary Every<br>"Pay it Forward!"<br><br>