More Nagios, More DAOS

I have configured 2 more services on my Nagios server to check the size and filecount of the DAOS repository.

The filecount is determined by the check_file plugin by Tevfik Karagulle and I use a simple script on my Windows 2003 host to get the folder size in KB.

Const intOK = 0
Const intWarning = 1
Const intCritical = 2
Const intUnknown = 3

strDrivePathFolder = Wscript.Arguments.Unnamed.Item(0)
strWarningValue = Wscript.Arguments.Unnamed.Item(1)
strCriticalValue = Wscript.Arguments.Unnamed.Item(2)

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(strDrivePathFolder)

FolderSize = CDbl(objFolder.Size)
strWarningValue = CDbl(strWarningValue)
strCriticalValue = CDbl(strCriticalValue)

If ( FolderSize > strWarningValue ) or ( FolderSize > strCriticalValue ) Then 
  'Wscript.Echo "Inside outer If statement."

  If (FolderSize > strCriticalValue) Then
    'Wscript.Echo "Inside CriticalValue If statement."
    Wscript.Echo "CRITICAL: Folder Size is " & FolderSize &"|Folder.Size=" & FolderSize & ";" &  strWarningValue & ";" & strCriticalValue
    Wscript.Quit(intCritical) 
  End If

  If (FolderSize > strWarningValue) Then
    'Wscript.Echo "Inside WarningValue If statement."
    Wscript.Echo "WARNING: Folder Size is " & FolderSize &"|Folder.Size=" & FolderSize & ";" &  strWarningValue & ";" & strCriticalValue
    Wscript.Quit(intWarning)
  End If

End If

Wscript.Echo "OK: Folder Size is " & FolderSize &"|Folder.Size=" & FolderSize & ";" &  strWarningValue & ";" & strCriticalValue
Wscript.Quit(intOK)

Both programs are invoked from the nagios server by starting the check_nrpe plugin .

The result looks like this:

nagiosDaos

Once there is enough data collected, you can create nice looking graphs.