GroundWork Foundation Feeders and Nagios Sample

Program Description

Overview

Collage reads data from feeders via a listener service. This service reads data posted to a TCP port and performs actions based on the message format. The XML data format to insert data into the Collage database is:
<{SERVICE_STATUS | HOST_STATUS | LOG_MESSAGE} database field=value | database field=value |...} />

Examples

For example, the following message sets the status for a service.

<SERVICE_STATUS HostName="zinal" ServiceDescription="check_disk" LastPluginOutput="OK Service running" />
Another type of action is to change the monitoring system configuration by adding or removing data objects. This XML data format is:

<SYSTEM_CONFIG action="{add|remove}" destination="{HostGroup|Device|MonitorServer}" destinationName= "Name of entry" collection="{Host|Devices}" collectionNames="Comma separated list" />
For example, the following message adds hosts to a hostgroup;

<SYSTEM_CONFIG action="add" destination="HostGroup" destinationName="demo-servers" collection="Host" collectionNames="torino,geneva,asti" />
The Nagios Feeder is a set of Perl scripts which dynamically reads data from Nagios, formats the XML message and sends the message packet to the Collage listener. There are two scripts.

nagios2collage_socket.pl This script reads the Nagios status log (status.log) to get current host and service status. It sends SERVICE_STATUS and HOST_STATUS message types to the Collage listener on a regular interval.
nagios2collage_eventlog.pl This script is a log file monitor that reads the Nagios event log (nagios.log). Updates to the log are sent to as LOG_MESSAGE type messages.