Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Geospatial monitoring plugins for Nagios
Python
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
docs
README.md
check_wms.py

README.md

About GeoNagios

GeoNagios is a plugin for the monitoring system Nagios. It tests the availability and performance of a geospatial web service, e.g. Web Map Service (WMS). It measures latency and size of response in bytes.

ProtocolImplemented byFinished
WMScheck_wms.py
WMTScheck_wmts.py
WFScheck_wfs.py
WCScheck_wcs.py
CSWcheck_csw.py
TMScheck_tms.py

GeoNagios has been developed with support from the Danish Geodata Agency, Grontmij and the University of Copenhagen, Department of Computer Science.

Dependencies

GeoNagios is written in Python (tested with 2.6 and 2.7). Dependencies are Python 2.5+ and pyproj. It currently only supports WMS, but additional protocols are planned.

# easy_install pyproj
pip install pyproj  # maybe need 'sudo' in front

Getting started with GeoNagios

Get a copy of check_wms.py:

curl -o check_wms.py https://raw.github.com/skipperkongen/GeoNagios/master/check_wms.py
chmod u+x check_wms.py

Get help by calling check_wms.py with the --help option:

$./check_wms.py --help

List the layers available for a WMS service by calling check_wms.py with the --list-layers option:

$ ./check_wms.py --list-layers 'http://kortforsyningen.kms.dk/service?ticket=1940ecb511e4d1a92df01347a85aa30f&servicename=dagi' 
politikreds
sogn
kommune
region
retskreds
opstillingskreds
postdistrikt

Test all the layers by calling check_wms.py without options (only the URL argument):

$ ./check_wms.py 'http://kortforsyningen.kms.dk/service?ticket=1940ecb511e4d1a92df01347a85aa30f&servicename=dagi' | tr ',' '\n' | tr '|' '\n'
OK
'time_get_capabilities'=710ms
'max_time'=330ms
'min_time'=62ms
'time_region'=330ms
'size_region'=1340B
'time_kommune'=76ms
'size_kommune'=1340B
'time_politikreds'=67ms
'size_politikreds'=1340B
'time_retskreds'=67ms
'size_retskreds'=1340B
'time_opstillingskreds'=62ms
'size_opstillingskreds'=1340B
'time_sogn'=71ms
'size_sogn'=1340B
'time_postdistrikt'=140ms
'size_postdistrikt'=1340B

Test some of the layers by calling check_wms.py with the --specific-layers option:

$ ./check_wms.py --specific-layers 'COMMA-SEPARATED-LAYER-NAMES' [SERVICEURL]

Test n randomly picked layers by calling check_wms.py with the --n-layers option:

$ ./check_wms.py --n-layers INTEGER [SERVICEURL]

Configure Nagios to use GeoNagios

Remember there are multiple ways to configurate Nagios. This is just one way!

Define host

Host template:

define host {
        name                            generic-wmshost ; The name of this host template
        hostgroups                      geospatial-servers
        notifications_enabled           0
        check_command                   check-wms
        check_interval                  1
        retry_interval                  1
        max_check_attempts              5
        check_period                    24x7
        event_handler_enabled           1               ; Host event handler is enabled
        flap_detection_enabled          1               ; Flap detection is enabled
        failure_prediction_enabled      1               ; Failure prediction is enabled
        process_perf_data               1               ; Process performance data
        retain_status_information       1               ; Retain status information across program restarts
        retain_nonstatus_information    1               ; Retain non-status information across program restarts
        register                        0               
}

Host:

define host {
        use             generic-wmshost
        host_name       plansystem
        alias           Plansystem - local plans for Denmark
        address         http://kort.plansystem.dk
    action_url  /wms?servicename=wms
}

Define command:

(I have defined $USER3$ to point to where check_wms.py is)

define command {
        command_name check_wms_py
        command_line    $USER3$/check_wms.py $HOSTADDRESS$$HOSTACTIONURL$ $ARG1$
}

Define service:

define service {
        use             generic-service
        host_name       plansystem, eea_europa, arealinfo, vienna, kortforsyningen
        service_description check_wms_services
        check_command   check_wms_py ! -n 5 --cache
}

Additional documentation

Something went wrong with that request. Please try again.