[Nagiosplug-help] nagios plugin with perl script

Kyle Smith kyles at apple.com
Wed Sep 17 22:23:13 CEST 2008


Here is a link to the nagios plugin developer guidelines - http://nagiosplug.sourceforge.net/developer-guidelines.html 
  - you should read this over first to get some basic ideas down.

For your own purposes you don't need to meet all the requirements  
there, you just need a script that does what you need.

You could change your script to accept values for "warning" and  
"critical" values (look at check_procs syntax, use the -c and -w  
flags) and then compare the amount of free space available to these  
values. Your script should do some basic error checking to ensure the  
warning level is higher than the critical level. If the free space is  
above both values then the script should write "DISK OK" to stdout  
(and more text if you wish) and then exit with a return code of 0  
(meaning everything is fine). If disk space is below warning level but  
above critical level then script should write "DISK WARNING" and exit  
with return code of 1. If free space is below warning and critical  
levels then the script should write "DISK CRITICAL" and exit with  
return code 2. Return code 3 and 4 are for other conditions but can't  
recall them now (you can look this up)..

Now you need to start your coding, you can use almost any language you  
wish.

good luck

kyle

On Sep 17, 2008, at 1:04 PM, Kalpesh Patel wrote:

> I have written perl script which gives the used disk space shown  
> below:
>
> For Ex.  check_disk_used --dir=/var
>
> output = Used Disk space on /var == 161.26MB 1.73%
>
> How can I use this script with check_nrpe to get it work from nagios  
> server?
>
> On Wed, Sep 17, 2008 at 3:59 PM, Kyle Smith <kyles at apple.com> wrote:
> O yes you are right, check_disk uses free space values to determine  
> if disk space is ok or not.
>
> You should write your own plugin if this will not work for you.
>
> good luck
>
> kyle
>
> On Sep 17, 2008, at 12:51 PM, Kalpesh Patel wrote:
>
>> Just to make sure...
>>
>> I am asking for getting used disk space not free disk space as per  
>> my original mail.
>>
>> Will this do?
>>
>> On Wed, Sep 17, 2008 at 3:44 PM, Kyle Smith <kyles at apple.com> wrote:
>> Use check_disk and the -p flag, follow -p with your nfs mounted  
>> filesystem
>>
>> good luck
>>
>> kyle
>>
>> On Sep 17, 2008, at 12:33 PM, Kalpesh Patel wrote:
>>
>>> but this is for checking local disks not NFS/mounts..right?
>>>
>>> I want to check the used disk space for all type of file systems.
>>>
>>> On Wed, Sep 17, 2008 at 1:21 PM, Alex Dehaini  
>>> <alexdehaini at gmail.com> wrote:
>>> udr check_local_disk plugin
>>>
>>> On Wed, Sep 17, 2008 at 5:15 PM, Kalpesh Patel <kalpesh2582 at gmail.com 
>>> > wrote:
>>> Hi,
>>>
>>> I am using perl script to get used disk space. I have to pass  
>>> variavle for the particular file system.
>>> I need help in using this script with check_nrpe plugin.
>>>
>>> For Ex.  check_disk_used --dir=/var
>>>
>>> output = Used Disk space on /var == 161.26MB 1.73%
>>>
>>> How can I use this script with check_nrpe ?
>>>
>>> Is there any plugin i can use to get used disk space?
>>>
>>> Thanks,
>>> Kalpesh
>>>
>>> -------------------------------------------------------------------------
>>> This SF.Net email is sponsored by the Moblin Your Move Developer's  
>>> challenge
>>> Build the coolest Linux based applications with Moblin SDK & win  
>>> great prizes
>>> Grand prize is a trip for two to an Open Source event anywhere in  
>>> the world
>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>> _______________________________________________
>>> Nagiosplug-help mailing list
>>> Nagiosplug-help at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
>>> ::: Please include plugins version (-v) and OS when reporting any  
>>> issue.
>>> ::: Messages without supporting info will risk being sent to /dev/ 
>>> null
>>>
>>>
>>>
>>>
>>> -- 
>>> Alex Dehaini
>>> Developer
>>> Site - www.alexdehaini.com
>>> Email - alexdehaini at gmail.com
>>>
>>> -------------------------------------------------------------------------
>>> This SF.Net email is sponsored by the Moblin Your Move Developer's  
>>> challenge
>>> Build the coolest Linux based applications with Moblin SDK & win  
>>> great prizes
>>> Grand prize is a trip for two to an Open Source event anywhere in  
>>> the world
>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________
>>> Nagiosplug-help mailing list
>>> Nagiosplug-help at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
>>> ::: Please include plugins version (-v) and OS when reporting any  
>>> issue.
>>> ::: Messages without supporting info will risk being sent to /dev/ 
>>> null
>>
>>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/help/attachments/20080917/06ed1857/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2413 bytes
Desc: not available
URL: <https://www.monitoring-plugins.org/archive/help/attachments/20080917/06ed1857/attachment.bin>


More information about the Help mailing list