[Nagiosplug-help] Nagios NRPE_nt False Positives take 2

Vincent K. Britton BrittonV at Wiznet.com
Thu Apr 24 16:20:20 CEST 2008


<sorry for the previous email, tried to paste but sent instead>

I am having a very strange problem.  After Months of working perfectly, NRPE is now triggering false positives on a disk check and sending critical errors on 2 of my Windows servers.  I am slowly rolling Nagios out, and these are the only 2 windows Servers I am checking disk space on.  I am also running Memory checks on these same servers and the results from it are working fine.

Here is the command on the Server in nrpe.cfg:
command[check_disk_c]=c:\windows\system32\cscript.exe //NoLogo //T:10 c:\nrpe_nt\bin\check_disk.wsf /drive:"c:\" /w:85% /c:90%

Here are the errors I am getting via email:
        ***** Nagios 2.10 *****

        Notification Type: PROBLEM

        Service: Disk Space C
        Host: Server01
        Address: 172.16.1.151
        State: CRITICAL

        Date/Time: Thu Apr 24 09:18:28 EDT 2008

        Additional Info:

        Drive C:\  - Total: 10 GB - Free: 2.2 GB (22%) - Used: 7.8 GB (78%)

As you can see the disk usage at 78% is below both the warning and critical thresholds.

The nrpe.cfg for Server 11 is exactly the same, but I am getting errors from that server as well:

        ***** Nagios 2.10 *****

        Notification Type: PROBLEM

        Service: Disk Space C
        Host: Server11
        Address: 172.16.1.169
        State: CRITICAL

        Date/Time: Thu Apr 24 08:59:18 EDT 2008

        Additional Info:

        Drive C:\  - Total: 58.6 GB - Free: 41.49 GB (71%) - Used: 17.1 GB (29%)

This server uses even Less disk percentage, but is triggering Critical errors.

How do I begin to troubleshoot this, is it a problem on the Windows Servers, or the Nagios Monitoring Server?  I imagine it is a problem with the Nagios Server, as the likely hood of both Windows servers developing the same problem at the same time is unlikely.

Here is some more information if relevant.

The version of NRPE:
        NRPE Plugin for Nagios
        Copyright (c) 1999-2007 Ethan Galstad (nagios at nagios.org)
        Version: 2.10
        Last Modified: 10-19-2007

Lastly here is the Windows Script that is running:


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' "check_disk.wsf"
' nagios at samurai.inka.de
'
' 03.06.2003 ver 1.13
' Type converting problems fixed
' New return string format
' Minor bugs in the help
' Auto MB or GB detect
' 13.06.2003 ver 1.13b (miwi)
'added support for Percentage in /w and /c
'
' --------------------------------------------------------------
' This plugin returns the Total, Free And Used space In MB And % of a given drive
'

<job>
<runtime>
  <description>
check_disk (nrpe_nt-plugin) 1.1
The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute
copies of the plugins under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
Copyright (c) 1999-2001 Ethan Galstad/Hagen Deike (nagios at samurai.inka.de)

This plugin returns the Total, Free And Used space In MB And % of a given drive.
  </description>
  <named
    name="h"
    helpstring="Help"
    type="simple"
    required="false"
  />
  <named
    name="drive"
    helpstring="The drive letter to check. See the example."
    type="string"
    required="true"
  />
  <named
    name="w"
    helpstring="Warning watermark. Defined in MB (/w:100) or % (/w:80%)"
    type="string"
    required="true"
  />
  <named
    name="c"
    helpstring="Critical watermark. Defined in MB (/c:100) or % (/c:90%)"
    type="string"
    required="true"
  />
  <example>
Example: check_disk.wsf /drive:"c:\" /w:200 /c:100
  </example>
</runtime>
<script language="VBScript">

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Const's and Var's
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Cons for return val's
Const intOK = 0
Const intWarning = 1
Const intCritical = 2
Const intUnknown = 3

' Cons for FSO
Const ForReading = 1
Const ForWriting = 2

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Help
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  If Wscript.Arguments.Named.Exists("h") Or Not Wscript.Arguments.Named.Exists("drive") Or Not Wscript.Arguments.Named.Exists("w") Or Not Wscript.Arguments.Named.Exists("c") Then
        Wscript.Echo "Plugin help screen:"
      Wscript.Arguments.ShowUsage()
      Wscript.Quit(intUnknown)
  End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Main
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Dim objFSO, objDrive, intFree, intTotal, intUsed, intFreePro, intUsedPro, strDriveName, strFreeType, strTotalType, strUsedType
Set objFSO = CreateObject("Scripting.FileSystemObject")

strDriveName = Wscript.Arguments.Named("drive")
strFreeType = "MB"
strTotalType = "MB"
strUsedType = "MB"

Set objDrive = objFSO.GetDrive(objFSO.GetDriveName(strDriveName))
intFree = CLng(FormatNumber(objDrive.FreeSpace/1048576, 0))
intTotal = CLng(FormatNumber(objDrive.TotalSize/1048576, 0))
intUsed = intTotal - intFree

intFreePro = (intFree*100)/intTotal
intUsedPro = (intUsed*100)/intTotal

intFreeOut = intFree
intUsedOut = intUsed
intTotalOut = intTotal
If intFreeOut > 1024 Then
        intFreeOut = Round(intFreeOut/1024,2)
        strFreeType = "GB"
End If
If intUsedOut > 1024 Then
        intUsedOut = Round(intUsedOut/1024,2)
        strUsedType = "GB"
End If
If intTotalOut > 1024 Then
        intTotalOut = Round(intTotalOut/1024,2)
        strTotalType = "GB"
End If

Wscript.Echo "Drive "& UCase(strDriveName) &" "& objDrive.VolumeName &" - Total: "& intTotalOut &" "& strTotalType &" - Free: "& intFreeOut &" "& strFreeType &" ("& Round(intFreePro,0) &"%) - Used: "& intUsedOut &" "& strUsedType &" ("& Round(intUsedPro,0) &"%)"

If InStr(Wscript.Arguments.Named("c"),"%") Then
        If intFreePro <=CInt(Replace(Wscript.Arguments.Named("c"),"%","")) Then
                Wscript.Quit(intCritical)
        End if
Else
        If intFree <= CInt(Wscript.Arguments.Named("c")) Then
                Wscript.Quit(intCritical)
        End if
End if

If InStr(Wscript.Arguments.Named("w"),"%") Then
        If intFreePro <=CInt(Replace(Wscript.Arguments.Named("w"),"%","")) Then
                Wscript.Quit(intWarning)
        End if
Else
        If intFree <= CInt(Wscript.Arguments.Named("w")) Then
                Wscript.Quit(intWarning)
        End if
End if
Wscript.Quit(intOK)

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
</script>
</job>




More information about the Help mailing list