Nagios is an Open Source network monitor that is available at http://www.nagios.org.
The nagios integration has two parts.
- The Log Analyser. This is a job which must run periodically in JobScheduler. This job examines the JobScheduler main log. If error messages or warnings are found, they will be stored in the JobScheduler database (Table SCHEDULER_MESSAGES).
- The nagios plugin. This is a perl script, which looks into the JobScheduler Database to find some error messages or warnings.
Installation of the nagios plugin
You need the perl > 5.8 and the perl packages NET::HTTP and DBI. You can install these packages from http://www.cpan.
- Unzip JobScheduler_nagios.tar.gz to any folder.
- gzip -d nagios.tar.gz
- tar -xvf nagios.tar
- Copy the files ./nagios/bin/plugin sos.check_scheduler.pl and ./nagios/bin/SOSScheduler.pm to the plugin directory of your nagios installation.
- Copy the config folder to the plugin directory of your nagios installation
- Create a file config/sos_settings.ini. You can use the example files in the config folder.
Configure your nagios with this plugin. For this, you have to add a service for each group of job chains or jobs you want to include in the monitoring. You also have to add the command for the plugin. You can use the file jobscheduler.cfg which have the example configuration. Please add the line cfg_filh1. /usr/local/nagios/etc/jobscheduler.cfg to your nagios.cfg configuration file to include this file.
Before restarting nagios, check your configuration with
Installation of the Log Analyser Job
To install the Log Analyser, you have to copy the folder config/live/Nagios to your JobScheduler configuration directory. You can adjust the runtime of the job JobSchedulerLogAnalyser. The default runtime for analysing the logfile is every 5 minutes. The default for resetting all messages is every day at 11:00 pm and for deleting messages from database every Monday at 7:00 am.
[ Parameter Description|http://www.sos-berlin.com/doc/JITL/JobSchedulerLogAnalyser.xml]
Installation of the table SCHEDULER_MESSAGES
If you are running JobScheduler with Version > 1.3.10, the table SCHEDULER_MESSAGES is already installed. In other cases, you find the create table command in the directory ./nagios/db/yourdb. Please install this table using your database client.
Testing your installation
- Execute the plugin in a shell
- Please make sure, that the job Nagios/ JobSchedulerLogAnalyser is running. You should see the job in JOC when opening host:port
- Open your nagios console. You should see the configured services.
- Check your nagios configuration with
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
How it works
You define the parameters for monitoring in the Nagios configuration file jobscheduler.cfg.
For example, if you have several JobScheduler instances running or you want to monitor different groups of jobs and job chains then you have to define one service for each JobScheduler or group of jobs and job chains. You can not mix group of jobs and group of job chains. You have to configure one service for job chains and one for jobs.
Test job blacklist and test/job3
Test job chain test/print_chain
- Nagios Plugin: Reading the database with error messages and warnings. You can start the plugin in your shell for example as follows:
- Job JobSchedulerLogAnalyser: Analysing log files and writing them into the database.
- Job JobSchedulerLogAnalyserReset: Resetting all messages.
- Job JobSchedulerLogAnalyserDelete: Deleting all messages.