NAGIOS specific informations

Some hints about monitoring using Nagios



Über mich

What you can find here

Nagios web service checker (nagios-wsc)

This is a plugin for Nagios to check Windows boxes. It allows to check all hosts within one domain through this service. You just have to install the web-service on just one host of the domain. Informations about the lastest release are located here.

This plugin was inspired by the check_mrtg plugin. It allows to read values vom rrd-database-files and return results to Nagios. It offers the same command-line parameters as the original one. So it should plugin smoothly.

This perl-script allows to capture STDOUT and STDERR of a nagios plugin. The output is written in a temp. file as well as returned to Nagios.
This allows to track down some error messages like "(Return code of 127 is out of bounds - plugin may be missing)".

2008-10-12NAGIOS-WSC v1.3.1 released

This release contains a fix in check "services".
The behaviour of using "*" as the list of services to be checked, has been enhanced: Now when you are using "*" only services with runmode "Auto" are checked.

You find the current stable release at SourceForge project page NAGIOS web service checker.

2006-12-03Debugging (your own) check-scripts

Sometimes check-plugins do not return expected results. Using the check-script within the shell seem to work correct. The problem sometimes occure only if running under the "nagios" user.


This has been replaced by a perl solution for capturing plugins output.

2006-11-12Nagios Checkscript

In our company we are currenty moving from MRTG to MRTG-RRD. We do have a lot of MRTG created datafiles. These datafiles are read by the check-plugin "check_mrtg". I've didn't find a script which is compatible to this one but is reading RRD-files created by MRTG.


There is very simple first version of a script to read RRD-files which is commandline compatible to the check_mrtg. It is derived from an original file named I'm calling it Feel free to use it.


2008-09-01NAGIOS-WSC v1.3 released

This release contains some bugfixes and new requests.

New requests to check:
CPU (new variants) CPU details (%user, %system) Exchange SMTP Queues Free space on volumes Enhancements Nagios 3.x compatible multiline output.

You find the current stable release at SourceForge project page NAGIOS web service checker.

2007-09-13NAGIOS-WSC v1.2.2 released

This release contains some bugfixes and implements two change requests.

Memory check now returns status information in better readable form (KB, MB, GB)
Memory check now returns performace data ifnso.

You find the current stable release at SourceForge project page NAGIOS web service checker.

Local links:
Zip-File (containing sources and .NET 1.1 and .NET 2.0 binaries)
Documentation (in pdf-format) (Perl plugin for Nagios checks)

Refer to my unusual way to create a local NAGIOS-WSC development environment for VS2005.

2007-07-25NAGIOS-WSC v1.2 released

This is new major release

New features:
ZIP-file contains both .NET 1.1 & 2.0 compiled runtime.
New check "File age".
New check "File count".
New check "File size".
Return of performance data for the checks cpu, disk, services, process and uptime.
New authenticatio method (domain accounts).

check_disks can new exclude a list of drives.
check_disk, check_disks & check_memory now accept values in kB, MB, GB and percent.

Local links:
Zip-File (containing sources and .NET 1.1 and .NET 2.0 binaries)
Documentation (in pdf-format) (Perl plugin for Nagios checks)

Refer to my unusual way to create a local NAGIOS-WSC development environment for VS2005.

2007-05-05NAGIOS-WSC v1.1.3 (bugfix)

This is just a bug fix release.
V1.1.3: Fixed: exception when having a lot of memory installed.
V1.1.2: Fixed: disk did not handle percentage values; querystring missing in error message.
V1.1.1: It fixes a problem using check "disks" against a windows cluster node which does have unmounted drive-letters.

You can download the bugfix (Release v1.1.3) for testing.
As soon as it is running properly in our production environment, I'll publish it on SF.

2007-03-09NAGIOS-WSC v1.1

Finally it's done. I've published version 1.1 of the Nagios web service checker nagios-wsc.
You find the current stable release at SourceForge project page NAGIOS web service checker.

Local links:
Zip-File (containing sources and .NET 1.1 binaries)
Documentation (in pdf-format) (Perl plugin for Nagios checks)

There's still a lot to do:

  • Update the projects home page
  • Wait if there's response to the new release
  • Check out features of SF project administration (e.g. CVS)
  • Think about new features for nagios-wsc
  • Rewamp this page (to find some neat things like found below)

2007-03-06Maintaining NAGIOS-WSC

The original maintainer of the project probably could not effort time to maintain the project, the project seemed to laimed dorment.
I requested the ability to administrate the project. The approval arrived during my trip to Barcelona.
This now gives me the opportunity to publish my current version to the public.

It will take some days to investigate the admin facilites. Within the next days I'll update the version on SourceForge.
Stay tuned.

2006-12-15 nagios_wsc webservice: Beta version v1.0.2 with new extensions

As a result of a discussion in the SourceForge forum I've got in touch with theifish @ SF. He offered me some neat extensions he implemented. I merged his new and modified features into my own version.
This version now has a better error detection and some enhancements for the other checks (requestet by the forum as well). Currenty there's only a simple description of the new features and a changelog.
You can download a first beta version as ZIP-file.

Thanks Konstantin for your great job!

2006-12-15Enhanced version of

The original version of this plugin (v0.6) lacks some problems in detecting invalid parameters. On the other hand there's no real errorchecking if unexpected results are returned from the webservice.
Link to download the enhanced version of

Corrections made

  • Detecting problems connecting the webservice
  • Returning result web-codes if the HTTP-request doesn't return Code 200
  • Returning error code in several cases where it didn't in the original version
  • Detect unexpected content (eg. due to customized error pages) formerly resulting in "no output"

Enhancements implemented

  • Option to specify a different URL where the .asmx is located
  • Debug option added
  • Timeout can be specified to wait for the response of the web-service
  • Useragent sent with the request is configurable

2006-12-04 nagios_wsc: Services not found are not detected

In addition to a discussion in the SF forum (subject: "Services not found should return a warning") I'm offering a quick solution. It displays a nagios warning if at least one service is not found in the service list while all others are in a "running" state. You want see directly which service is missing, but it's just a quick fix ;-).
Have a look at my listing of known problems.

Changes to the code Service1.asmx.vb (based on SF version v1.0)

Added lines are displayed in bold. This modification is currently NOT included in the download ZIP.

Dim stopped As Boolean = False 
Dim FoundServiceCount As Integer = 0
For Each obj In mos.Get() 
  If res_str <> "" Then res_str = res_str & "<br>" 
  If LCase(obj("state")) <> "running" Then 
    stopped = True 
    res_str = res_str + "<b>" 
  End If 
  res_str = res_str + obj("state") + "-" + obj("name") 
  If LCase(obj("state")) <> "running" Then 
    res_str = res_str + "</b>" 
  End If 
  FoundServiceCount = FoundServiceCount + 1

If stopped Then 
  Return wsc_version & "Result: Service(s) Critical<br>" + res_str 
ElseIf (FoundServiceCount <> myarr.Length) Then 
  Return wsc_version & "Result: Service(s) missing Warning<br>" + res_str 
  Return wsc_version & "Result: Service(s) Okay<br>" + res_str 

2006-12-02Nagios Web Service Checker nagios_wsc

This little utility is a nice way to check multiple NT-servers through a single gateway server. It uses a web service to communicate to servers. Results are returned by a simple XML-structure. The implementation is by no means perfect and leaks several problems. The original version 1.0 is found as a project under SourceForge named NAGIOS web service checker. Because currently there seem to exist no support to the project, I provide a slightly enhanced version.

Nagios Web Service Checker nagios_wsc v1.0a

nagios_wsc v1.0a has been replaced by. Look out for the current archive.

Known problems solved

  • Invalid hostname lets the webservice die
  • Invalid Servername is not recognized, OK returned instead
  • Uptime sometimes is invalid if timezone other than GMT
  • errorhandling converting parameters in function disks
  • generally implemented a simple errorhandler which now should return a valid html-result in many cases even if an internal exception occured

Unsolved problems from version v1.0

  • Checking "services": misspelled servicenames are not detected
  • More robust error handling in
  • Seems that is not running using the embeeded perl interpreter v0.6 hints

  • Can't locate object method "write_request" via package "can't connect" (perhaps you forgot to load "can't connect"?) at /usr/local/bin/ line 27.
    Invalid gateway host specified or webservice not running correctly.
    When executing the shell-command you possible mixed up the addresses for -H and -p.
  • Can't call method "write_request" on an undefined value at /usr/local/bin/ ...
    could not connect to the gateway host.
  • The webservice seems to never return a value
    It just might take about 1 minute that the webservice discovers that the address which should be checked is unreachable. This might look like "never returning".
  • Status-Message "no output" in Nagios
    This can happen in many situations. Eg. you specified an invalid server which returned a custom error-page. If you are using the original web-service a exception might have occured (invalid parameters, unknown host to be checked). etc.

2006-11-12Nagios Servicecheck keeps hanging in the check queue

Environment: PERL-check-ccript, Nagios is compiled with the embedded Interpreter. It seems to happen, that due to a compile error (or caching?) the check will stay in the check queue. This happens allthough the script runs well using a standard Perl interpreter.



What is Nagios?

Nagios is a host and service monitor designed to inform you of network problems before your clients, end-users or managers do. Just to say: Thank you Ethan.

(c) Wolfgang Wagner, Vienna, 2007