[Nagiosplug-help] (no subject)
Kyle Smith
kyles at apple.com
Sat May 15 00:05:46 CEST 2010
Have your script output a text string ("check is OK", "check is Critical") and exit with an integer return code. Check_nrpe will interpret the rc thusly:
0 - ok
1 - warning
2 - critical
3 - internal error
HTH
kyle
On May 14, 2010, at 2:51 PM, Bill Lopez wrote:
> Charles -
>
> The reason I am checking using nrpe and a vb script is because the methods you recommended are for checking locally attached drives, I am checking MOUNTED disks - and to explain in greater detail - they are mounted CIFS Filesystems from an EMC Celerra.
>
> I have been using Nagios since it was NetSaint, just never bothered to monitor using anything outside the realm of "out of the box" checks. As with other custom plugins, I want to know how Nagios Process interprets or identifies what is a warning or a critical value?
>
> I've tried passing logic into the vb script to produce an OK WARNING and CRITICAL field in front of the output,
>
>
>> I'm curious why you want to use a vbscript instead of following the
>> standard way of doing it as outlined here:
>>
>> http://nagios.sourceforge.net/docs/3_0/monitoring-windows.html
>>
>> --
>> Charles H. Baker, Unix System Administration
>> Windstream Communications
>> Charles.Baker at windstream.com | 864.331.7896 | 864.990.1297
>> Be the change you wish to see in the world. Gandhi
>
>
>
>> On Fri, 2010-05-14 at 07:43 -0700, Bill Lopez wrote:
>> I have a vb script that checks mounted disk size and pukes out the numbers (all included below)
>>
>>
>> how does nagios know to show warning and critical?
>>
>> how do I get nagios to understand what values should be used for WARNING and CRITICAL ?
>>
>> here is the vb script
>>
>> ---------------
>>
>> On Error Resume Next
>> strComputer = "."
>> Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
>> Set colItems = objWMIService.ExecQuery _
>> ("Select * from Win32_MappedLogicalDisk Where Name = 'F:' ")
>>
>> For Each objItem in colItems
>>
>> disk_total=objItem.Size/(1024*1024*1024)
>>
>> disk_used=(objItem.Size-objItem.FreeSpace)/(1024*1024*1024)
>> disk_used_perc=disk_used/disk_total
>> disk_free=objItem.FreeSpace/(1024*1024*1024)
>> disk_free_perc=disk_free/disk_total
>>
>>
>>
>>
>> Wscript.Echo objItem.ProviderName & "- total: " & Round(disk_total, 2) & " Gb" & " - used: " & Round(disk_used, 2) & " Gb" & " (" & Round(disk_used_perc*100) & "%)" & " - free: " & Round(disk_free, 2) & " Gb" & " (" & Round(disk_free_perc*100) & "%)"
>>
>> Next
>>
>> ---------------
>>
>> text output from the script is
>>
>> \\servername\FS300- total: 246.19 Gb - used: 110.13 Gb (45%) - free: 136.05 Gb (55%)
>>
>> nagios display shows
>> DISKSPACE FS301 OK 05-13-2010 20:50:05 0d 3h 30m 42s 1/4 \essnas1FS301- total: 246.19 Gb - used: 207.88 Gb (84%) - free: 38.3 Gb (16%)
>>
>
>
>
>
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> 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
More information about the Help
mailing list