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.


Nagios, Centreon and DAOS

heA few days ago, I started to play with Nagios. Nagios is a powerful monitoring system that enables organizations to identify and resolve IT infrastructure problems before they affect critical business processes.

I’ve setup a Linux VM using CentOS 5. As always when you install a package on Linux, there are several dependencies and sometimes it is hard to get it all done. I found a small script in the web that has been created to do the setup of Nagios and Nagios Plugins as well as ndoutils and mysql and stuff.

It also installs Centreon. Centreon (a.k.a Oreon) is a GUI for Nagios.  As you can see from the screenshot, I have successfully installed and configured all components.

nagiosplugin

Nagios and Centreon are Open Source products and can be used at no charge. There are several plugins for all kinds of checks available.

The most flexible wy to check a process state or get statistic values is using SNMP. With SNMP you do not need to install any client on the server. Read the Administration help on how to enable SNMP for Domino.

All of the plugins that came with Nagios uses a threshold to determine the state of a value ( OK, CRITICAL, WARNING … ).

I wanted to check the DAOS Catalog state on my Domino but was not able to do so, because the SNMP request return a non-numeric value. Non-numeric values cannot be passed as a parameter to the plugin.

I decided to write my own plugin from scratch. You can write plugins for Nagios in Perl. The Nagios::Plugin module from CPAN makes it easy to write a Nagios plugin even when you are an unexpierienced Perl developer like me.I learned the basics from the 15 minutes screencast by Ton Voon.

You can download the source code for check_domino_eknori.pl here.

To perform a normal check, start the script with the following syntax

./check_domino_eknori.pl -H 192.168.178.20 -C SINGULTUS -o Mail.Dead -c 9 -w 6

If you want to check for non-numeric return values, you have to tweak the -o parameter

./check_domino_eknori.pl -H 192.168.178.20 -C SINGULTUS -o Synchronized~DAOS.Engine.Catalog -c “Needs Resync” -w Resyncing

Simply put the value that will reflect the OK state before the object and seperate both values with a ~  (Tile).

The output looks like this

DOMINO OK – DAOS.Engine.Catalog – Synchronized

If you ere attending AdminCamp 2009 and you want to get more information about how to monitor you Domino server environment with Nagios, visit Christoph Stoettner’s session.

And if you want to watch a developer talking admin stuff, please vistit my session on DAOS.  ( Read agenda ) Not yet registered? Read here how to save money and register today for AdminCamp 2009 in Gelsenkirchen, Germany!