...
Nagios is an Open Source network monitor that is available at http://www.nagios.org.
Installation
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.
...
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
- 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.
...
Panel | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||
|
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:
...