SNMP/Windows disk usage

mark.potter at academy.com mark.potter at academy.com
Wed Feb 20 15:56:17 CET 2008


"Valdinger, Stephen (DOV, MSX)" <svalding at doverchem.com> wrote on 
02/20/2008 07:09:34 AM:

> -----Original Message-----
> From: Melanie Pfefer [mailto:melanie_pfefer at yahoo.co.uk] 
> Sent: Wednesday, February 20, 2008 8:01 AM
> To: mark.potter at academy.com
> Cc: nagios-users at lists.sourceforge.net
> Subject: Re: [Nagios-users] SNMP/Windows disk usage
> 
> Hello again
> 
> I downloaded the perl script and indeed I can use it
> manually:
> ./check_snmp_storage.pl -H TROY -C public -m ^[CDE]:
> -w 80% -c 90%
> 
> D:\ Label:  Serial Number 225e3590:
> 3%used(2587MB/89495MB) C:\ Label:  Serial Number
> 8cfa6a13: 27%used(6644MB/25000MB) (<80%) : OK
> 
> 
> 
> In nagios, I should define a service and a command to
> start using check_snmp_storage.pl. Could you please
> help in what I should add?
> 
> Many thanks
> 
> <<snip>>
> 
> Melanie, 
> 
>    Here is a sample command and service definition that I use with
> this plugin:
> 
> In commands.cfg:
> 
> define command{
>         command_name    check_c:\
>         command_line    $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$
> -C $USER3$ -m ^C: -w 85 -c 95
>         }
> 
> In services.cfg (or wherever you place your service definitions)
> 
> define service{
>    use   generic-service
>    host_name   <yourhostnamehere>
>    service_description   Check C:\ Usage Data
>    check_command   check_c:\
>    }
> 
> This is how we use it on our network, your needs may be different. 
> Remember when testing to plugin to test as root and to chown
> nagiosuser.nagiosgroup when you put it into libexec for it to work
> correctly. 
> 

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20080220/9f4eb154/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
-------------- 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