Introduction

  • System Monitors are tools that execute repeated checks for the availability of software products. 
    • For example, Nagios® is an Open Source System Monitor that is available at http://www.nagios.org.
    • An ecosystem of more or less compatible System Monitors has evolved, e.g. op5®, checkmk® and many others.
  • Users can monitor JS7 with both Open Source and commercially licensed products to check the availability of the JOC Cockpit, Controller and Agents.

Active and Passive Checks

  • Active Checks are initiated from the System Monitor server and are performed on a regular basis, e.g. every 5 minutes.
    • The purpose of Active Checks is to verify the availability of the JS7 products.
    • This type of check does not provide information about the execution status of individual jobs.
    • Active Checks make use of the JS7 - REST Web Service API. For efficiency the checks are implemented with Perl.
    • The System Monitor Plugins described in this article are intended for Active Checks.
  • Passive Checks are initiated from the JOC Cockpit and report execution results from workflows and jobs to a System Monitor.
    • This mechanism is by far more accurate and efficient than polling the JS7 History for failed workflows and jobs.
    • The JS7 - Notifications can be used for management of complex Passive Checks that are forwarded to a System Monitor.

Download and Installation of the Plugins

Download

Both Plugins include checking the availability of JOC Cockpit.

Installation

Copy the files to the plugin directory of your System Monitor installation.

Configuration of the Plugins

The configuration for the JS7 Controller and Agent Plugins includes definitions of

  • a System Monitor Command that specifies the parameterization of the Plugin and
  • a System Monitor Service that is the visible point of control in the System Monitor console.

JS7 Controller Plugin

Sample Configuration:

Example for JS7 Controller Plugin Command configuration
# 'check_js7_controller' command definition
define command {
    command_name                check_js7_controller
    command_line                /opt/plugins/check_js7_controller.pl -j $ARG1$ -i $ARG2$ -a $ARG3$ -t $ARG4$
}
Example for JS7 Controller Service configuration
 define service {
 use                             generic-service                 
 host_name                       localhost
 service_description             JS7Controller
 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     check_js7_controller!http://localhost:4446!jobscheduler!test:test!5!
 active_checks_enabled           1          
 passive_checks_enabled          0  
}


Parameterization:

Option

Option (long format)

Data TypeRequired

Default

Description

-j--joc-urlStringyes—URL of JOC Cockpit (HTTP and HTTPS are supported)
-i--idStringyes—ID of a JS7 Controller
-a--accountStringyes—Account for HTTP authentication with JOC Cockpit (<user:password>)

-c

--cafile

Stringno

—

Location of a certificate file or a CA bundle file to verify the SSL connection to JOC Cockpit

-C

--capath

Stringno

—

Path to a directory that includes certificate files or CA bundle files to verify the SSL connection to JOC Cockpit

-l--client-certStringno—Location of Client Authentication certificate file
-L--client-keyStringno—Location of Client Authentication key file
-s--hostname-verificationSwitchnofalseThis switch activates SSL hostname verification (recommended)

-t

--timeout

Numberno

30

Timeout in seconds for establishing the connection to JOC Cockpit

-d--detailedSwitchnofalse

This switch causes status information for each Controller instance to be returned. A Cluster can include two Controller instances.


Examples:

Example for Active Check of JS7 Controller using HTTP
# The JS7 Controller is operated for the ID 'jobscheduler' and JOC Cockpit URL is http://localhost:4446 with the account (user and password 'test') enabled
 
<path_to_plugins>/check_js7_controller.pl -j http://localhost:4446 -i jobscheduler -a test:test
Example for Active Check of JS7 Controller using HTTPS
# The JOC Cockpit URL is https://joc-2-0-primary.sos:7443 with the Root CA Certificate available from root-ca.crt
 
<path_to_plugins>/check_js7_controller.pl -j https://joc-2-0-primary.sos:7443 --ca-cert=./root-ca.crt -i jobscheduler -a test:test
Example for Active Check of JS7 Controller using Client Authentication Certificate
# A Client Authentication Certificate is used for the Certificate Identity Service instead of user/password
 
<path_to_plugins>/check_js7_controller.pl -j https://joc-2-0-primary.sos:7443 --ca-cert=./root-ca.crt -i jobscheduler --client-key ./agent-2-0-primary.rsa.key --client-cert ./agent-2-0-primary.rsa.crt

Notes:

  • Perl > 5.8 is required and some Perl packages are required. You can download and install Perl packages from e.g. http://www.cpan.

    • HTTP::Request

    • LWP::UserAgent

    • LWP::Protocol::https (if HTTPS is used to connect to JOC Cockpit)
    • JSON
    • MIME::Base64
  • For use with HTTPS the Root CA Certificate is picked up from a system default location or is specified from the --ca-cert argument pointing to the related file.
  • For use with HTTPS and certificate based authentication, the JS7 - Certificate Identity Service must be in place. The --client-key and --client-cert arguments point to the location of the related files. No user account or password is specified.

JS7 Agent Plugin

A service Command has to be declared before configuring the System Monitor Service that makes use of this Command.

Sample Configuration:

Example of JS7 Agent Plugin Command configuration with JOC Cockpit
# 'check_js7_agent' command definition
define command {
    command_name                check_js7_agent
    command_line                /opt/plugins/check_js7_agent.pl -j $ARG1$ -i $ARG2$ -a $ARG3$ -t $ARG4$
}
Example of JS7 Agent Service configuration
define service {
 use                             generic-service                 
 host_name                       localhost
 service_description             JS7Agents
 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     check_js7_agent!http://localhost:4446!jobscheduler!test:test!5!
 active_checks_enabled           1          
 passive_checks_enabled          0  
}


Parameterization:

Option

Option (long format)

Data TypeRequired

Default

Description

-j--joc-urlStringyes—URL of JOC Cockpit (HTTP and HTTPS are supported)
-i--idStringyes—ID of a JS7 Controller
-a--accountStringyes—Account for HTTP authentication to JOC Cockpit (<user:password>)

-A

--agent

Stringno

—

Agent ID of an Agent, can be repeatedly specified

-c

--cafile

Stringno

—

Location of a certificate file or a CA bundle file to verify the SSL connection to JOC Cockpit

-C

--capath

Stringno

—

Path to a directory that includes certificate files or CA bundle files to verify the SSL connection to JOC Cockpit

-l--client-certStringno—Location of Client Authentication certificate file
-L--client-keyStringno—Location of Client Authentication key file
-s--hostname-verificationSwitchnofalseThis switch activates SSL hostname verification (recommended)

-t

--timeout

Numberno

30

Timeout in seconds for establishing the connection to JOC Cockpit

-d--detailedSwitchnofalse

This switch causes status information for each Agent instance to be returned individually


Examples:

Example for Active Check of all JS7 Agents with JOC Cockpit
# The JS7 Controller is operated for the ID 'jobscheduler' and the JOC Cockpit URL is http://localhost:4446 with the account (user and password 'test') enabled

<path_to_plugins>/check_js7_agent.pl -j http://localhost:4446 -i jobscheduler -a test:test
Example for Active Check of JS7 Agents using HTTPS
# The JOC Cockpit URL is https://joc-2-0-primary.sos:7443 with the Root CA Certificate available from root-ca.crt
 
<path_to_plugins>/check_js7_agent.pl -j https://joc-2-0-primary.sos:7443 --ca-cert=./root-ca.crt -i jobscheduler -a test:test
Example for Active Check of JS7 Agents using Client Authentication Certificate
# A Client Authentication Certificate is used for the Certificate Identity Service instead of user/password
 
<path_to_plugins>/check_js7_agent.pl -j https://joc-2-0-primary.sos:7443 --ca-cert=./root-ca.crt -i jobscheduler --client-key ./agent-2-0-primary.rsa.key --client-cert ./agent-2-0-primary.rsa.crt
Example for Active Check of specific JS7 Agents with JOC Cockpit
# The check is performed for specific Agents identified by their Agent ID

<path_to_plugins>/check_js7_agent.pl -j http://localhost:4446 -i jobscheduler -a test:test --agent agent_001 --agent agent_002

Notes:

  • Perl > 5.8 is required and some Perl packages are required. You can download and install Perl packages from e.g. http://www.cpan.

    • HTTP::Request

    • LWP::UserAgent

    • LWP::Protocol::https (if HTTPS is used to connect to JOC Cockpit)
    • JSON
    • MIME::Base64
    • Cwd
  • For use with HTTPS connections and Client Authentication instead of user/password authentication, the same applies as to the JS7 Controller Plugin.

Report Script per Agent:

  • check_js7_agent.pl calls an optional script report_js7_agent.pl per Agent.
  • This script does not connect to JOC Cockpit or perform any checks but simply serves to create individual notifications per Agent to the System Monitor.
  • The script is executed if it is available from the same directory as the calling script and has to be executable.
  • The script is parameterized to transfer the message type and notification to the System Monitor. Positional arguments are used.
    • report_js7_agent.pl <joc-cockpit-url> <controller-id> <agent-url> <agent-status>
    • <joc-cockpit-url> is the URL that has been specified as a parameter to the script check_js7_agent.pl
    • <controller-id> is the Controller ID which has been specified as a parameter to the script check_js7_agent.pl
    • <agent-url> is the URL identifying the Agent
    • <agent-status> is one of "COUPLED" , "RESETTING", "RESET", "COUPLINGFAILED", "SHUTDOWN", "UNKNOWN"

      Example of report_js7_agent.pl
      #!/usr/bin/env perl
      use strict;
      use warnings;
       
      my ($jocUrl, $controllerId, $agentUrl, $agentStateText) = @ARGV;
      # do something with $jocUrl, $controllerId, $agentUrl, $agentStateText