Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Nagios is an Open Source network monitor that is available at http://www.nagios.org.

Installation

The nagios integration has two parts.

  1. 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).
  2. 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.

...

Code Block
 /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

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

  1. Execute the plugin in a shell

...

  1. Please make sure, that the job Nagios/ JobSchedulerLogAnalyser is running. You should see the job in JOC when opening host:port
  2. Open your nagios console. You should see the configured services.
  3. 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.

...

Panel
title Parameter
title Parameter
1borderStylh1. dashed
2borderColor#ccc
bgColor#fff

Parameter

long

Default

Description

-H,

--hostname

Name or IP address of the host JobScheduler is running

-p

--port

Port that JobScheduler listens to

-m

--max

optional: todo

-i

--scheduler_id

optional: When the log analyser finds an entry in the log file then that message will be stored in a database. If log analyser finds the message once more then a counter for this message will be incremented. With this parameter you can specify that only messages with a counter less than the given value are monitored.

-f

--file_configuration

optional: You can specify all parameters in a configuration file. The name of the file is specified with this parameter.

-c

--job_chain

optional: Defines a filter for job chains which should be monitored. The names of the job chains are set in a list with comma.

-j

--job

optional: Defines a filter for jobs which should be monitored. The names of the jobs are set in a list with comma.

Example

Test job blacklist and test/job3

Code Block
 define service {
 use                             generic-service                 
 host_name                       localhost
 service_description             SchedulerLog
 is_volatile                     0
 check_period                    24x7
 max_check_attempts              1
 normal_check_interval           1
 retry_check_interval            1
 contact_groups                  admins
 notification_options    w,u,c,r
 notification_interval           960
 notification_period             24x7
 check_command     sos_check_scheduler!prodscheduler!4444!0!blacklist,test/job3!!
 active_checks_enabled           1          
 passive_checks_enabled          1
}

Test job chain test/print_chain

Code Block
 define service { 
 use                             generic-service                 
 host_name                       localhost
 service_description             SchedulerLog
 is_volatile                     0
 check_period                    24x7
 max_check_attempts              1
 normal_check_interval           1
 retry_check_interval            1
 contact_groups                  admins
 notification_options    w,u,c,r
 notification_interval           960
 notification_period             24x7
 check_command     sos_check_scheduler!prodscheduler!4444!0!!print_chain!
 active_checks_enabled           1          
 passive_checks_enabled          1
 }
Code Block
 # 'check_scheduler' command definition
 define command {
 command_name    sos_check_scheduler
 command_line    /home/nagios/sos_check_scheduler.pl 
 -i $ARG1$ -H $HOSTADDRESS$ -p $ARG2$ -m $ARG3$ -j $ARG4$ -c  $ARG5$ 
}        

Implementation

  • Nagios Plugin: Reading the database with error messages and warnings. You can start the plugin in your shell for example as follows:
     

...