h2. Defining your Petals ESB hosts
For each Petals ESB node of your Petals ESB topology, create an instance of the template 'petals-esb-host'.
According to our environment defined above, create the file 'petals-esb-host-node1.cfg' in the directory '/etc/nagios3/conf.d' with the following content:
{code}
define host{
use petals-esb-host ; Name of host template to use
host_name petals-esb-node-1
alias Petals ESB Node 1
address 127.0.0.1
_snmpport 16161 ; This value should be set with the SNMP
; agent listener port of your Petals ESB node.
}
{code}
and create the file 'petals-esb-host-node2.cfg' in the directory '/etc/nagios3/conf.d' with the following content:
{code}
define host{
use petals-esb-host ; Name of host template to use
host_name petals-esb-node-2
alias Petals ESB Node 2
address 127.0.0.1
_snmpport 16162 ; This value should be set with the SNMP
; agent listener port of your Petals ESB node.
}
{code}
h2. Defining your Petals ESB topology as a Petals ESB host group
The Petals ESB topology can be considered as a Nagios host group composed of your Petals ESB nodes.
So, according to our environment defined above, create the file 'petals-esb-hostgroup.cfg' in the directory '/etc/nagios3/conf.d' with the following content:
{code}
define hostgroup {
hostgroup_name petals-esb
alias Petals ESB
members petals-esb-node-1, petals-esb-node-2
}
{code}
h2. Petals ESB host services
A best practice to monitor Petals ESB nodes is to create a template of services to associate to each Petals ESB nodes.
According to our environement defined above, create the file 'petals-esb-services.cfg' in the directory '/etc/nagios3/conf.d' with the following content:
{code}
# Define a service to check the disk space of the root partition# Define a service to check the disk space of the root partition
# on the local machine. Warning if < 20% free, critical if
# < 10% free space on partition.
define service{
use generic-service
hostgroup_name petals-esb
service_description Disk Space
check_command check_all_disks!20%!10%
}
# Define a service to check the load on the local machine.
define service{
use generic-service
hostgroup_name petals-esb
service_description Current Load
check_command check_load!5.0!4.0!3.0!10.0!6.0!4.0
}
# Define a service to check the heap memory used by Petals ESB node.
# Warning if > 85% configured max heap size, critical if 95% configured
# max heap size.
# Note: The value returned by the SNMP Get is a byte value. So, for
# a max heap size of 1Go:
# 85% => 912680550 bytes,
# and 95% => 1020054733 bytes
define service{
use generic-service
hostgroup_name petals-esb
service_description Current heap memory
check_command jvm_heapused!public!2c!912680550!1020054732
}
# Define a service to check the max (commited) heap memory used by Petals ESB node.
# Warning if > Warning if > 85% configured max heap size, critical if 95% configured
# max heap size.
# Note: The value returned by the SNMP Get is a byte value. So, for
# a max heap size of 1Go:
# 85% => 912680550 bytes,
# and 95% => 1020054733 bytes
define service{
use generic-service
hostgroup_name petals-esb
service_description Current commited heap memory size
check_command jvm_heapmaxused!public!2c!912680550!1020054732
}
{code}
h2. Restart Nagios
Restart your Nagios service to take into account the configuration.
{column}
{section}