<br><font size=2 face="sans-serif"><br>
</font>
<br>
<br><tt><font size=2>"Valdinger, Stephen (DOV, MSX)" <svalding@doverchem.com>
wrote on 02/20/2008 07:09:34 AM:<br>
<br>
> -----Original Message-----<br>
> From: Melanie Pfefer [</font></tt><a href=mailto:melanie_pfefer@yahoo.co.uk><tt><font size=2>mailto:melanie_pfefer@yahoo.co.uk</font></tt></a><tt><font size=2>]
<br>
> Sent: Wednesday, February 20, 2008 8:01 AM<br>
> To: mark.potter@academy.com<br>
> Cc: nagios-users@lists.sourceforge.net<br>
> Subject: Re: [Nagios-users] SNMP/Windows disk usage<br>
> <br>
> Hello again<br>
> <br>
> I downloaded the perl script and indeed I can use it<br>
> manually:<br>
> ./check_snmp_storage.pl -H TROY -C public -m ^[CDE]:<br>
> -w 80% -c 90%<br>
> <br>
> D:\ Label:  Serial Number 225e3590:<br>
> 3%used(2587MB/89495MB) C:\ Label:  Serial Number<br>
> 8cfa6a13: 27%used(6644MB/25000MB) (<80%) : OK<br>
> <br>
> <br>
> <br>
> In nagios, I should define a service and a command to<br>
> start using check_snmp_storage.pl. Could you please<br>
> help in what I should add?<br>
> <br>
> Many thanks<br>
> <br>
> <<snip>><br>
> <br>
> Melanie, <br>
> <br>
>    Here is a sample command and service definition that
I use with<br>
> this plugin:<br>
> <br>
> In commands.cfg:<br>
> <br>
> define command{<br>
>         command_name    check_c:\<br>
>         command_line    $USER1$/check_snmp_storage.pl
-H $HOSTADDRESS$<br>
> -C $USER3$ -m ^C: -w 85 -c 95<br>
>         }<br>
> <br>
> In services.cfg (or wherever you place your service definitions)<br>
> <br>
> define service{<br>
>    use   generic-service<br>
>    host_name   <yourhostnamehere><br>
>    service_description   Check C:\ Usage Data<br>
>    check_command   check_c:\<br>
>    }<br>
> <br>
> This is how we use it on our network, your needs may be different.
<br>
> Remember when testing to plugin to test as root and to chown<br>
> nagiosuser.nagiosgroup when you put it into libexec for it to work<br>
> correctly. <br>
> <br>
</font></tt>
<br><tt><font size=2>Some systems may have issues with the "\"
in a command name. I have seen it blow things up so there is a point on
which care needs to be taken. I would also recommend against hard coding
-w and -c values where at all possible. It makes using the same command
for multiple services with different needs much more difficult. Also you
should always test as the nagios user and not as root. Testing as root
really does nothing other than show permissions and rights issues if the
command fails to work as the nagios user. The script should be in libexec,
owned by the nagios user and group, and tested as the nagios user. If that
doesn't work then test it as root for the same dir with the same ownership
to see if it works at all.<br>
</font></tt>