# # Copyright (c) 2013-2024 Linagora # # This program/library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 2.1 of the License, or (at your # option) any later version. # # This program/library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License # for more details. # # You should have received a copy of the GNU Lesser General Public License # along with this program/library; If not, see http://www.gnu.org/licenses/ # for the GNU Lesser General Public License version 2.1. # ######################################################################### #### Nagios base configuration for Petals ESB #### #### ( Christophe DENEUX - Linagora ) #### ######################################################################### ######################################################################## #### Define your Petals ESB administrators, through a contact group #### ######################################################################## define contact { contact_name cde alias Christophe DENEUX host_notification_period 24x7 service_notification_period 24x7 host_notification_options d,u,r service_notification_options w,u,c,r host_notification_commands notify-host-by-email service_notification_commands notify-service-by-email email christophe.deneux@linagora.com } define contactgroup { contactgroup_name petals-esb alias Petals ESB Administrators members cde } ########################################################### #### We define a host template dedicated to a JVM host #### ########################################################### define host{ use generic-host name jvm-host ; The name of this host template notifications_enabled 1 ; Host notifications are enabled event_handler_enabled 1 ; Host event handler is enabled flap_detection_enabled 1 ; Flap detection is enabled failure_prediction_enabled 1 ; Failure prediction is enabled process_perf_data 1 ; Process performance data retain_status_information 1 ; Retain status information across program restarts retain_nonstatus_information 1 ; Retain non-status information across program restarts check_command check-host-alive max_check_attempts 10 notification_interval 0 notification_period 24x7 notification_options d,u,r register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE! # Specific attributes _snmpport 161 ; Listening port of the JVM SNMP agent } ############################################################################## #### We define a host template dedicated to Petals ESB host as a JVM host #### ############################################################################## define host{ use jvm-host name petals-esb-host ; The name of this host template register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE! contact_groups petals-esb # Specific attributes _snmpport 16161 ; Listening port of the JVM SNMP agent. Redefined because Petals is not started by 'root' _jmxport 7700 ; Listening port of the Petals JMX agent _jmxuser petals ; JMX credentials: username _jmxpassword petals ; JMX credentials: password } ######################################################### #### Dedicated commands to monitor a Petals ESB node #### ######################################################### # 'jvm_heapused' command definition to get the current size of the JVM heap define command{ command_name jvm_heapused command_line /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -p '$_HOSTSNMPPORT$' -C '$ARG1$' -P '$ARG2$' -o 1.3.6.1.4.1.42.2.145.3.163.1.1.2.11.0 -w :'$ARG3$' -c :'$ARG4$' -l load } # 'jvm_heapmaxused' command definition define command{ command_name jvm_heapmaxused command_line /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -p '$_HOSTSNMPPORT$' -C '$ARG1$' -P '$ARG2$' -o 1.3.6.1.4.1.42.2.145.3.163.1.1.2.12.0 -w :'$ARG3$' -c :'$ARG4$' -l load } ######################################### #### Petals nodes of the ESB as host #### ######################################### define host{ use petals-esb-host host_name petals-esb-node-1 alias Petals ESB Node 1 address 127.0.0.1 # Specific attributes: Uncomment to specify a value different from the default one # _snmpport 16161 ; Listening port of the JVM SNMP agent # _jmxport 7700 ; Listening port of the Petals JMX agent # _jmxuser petals ; JMX credentials: username # _jmxpassword petals ; JMX credentials: password } define host{ use petals-esb-host host_name petals-esb-node-2 alias Petals ESB Node 2 address 192.168.1.25 # Specific attributes: Uncomment to specify a value different from the default one # _snmpport 161 ; Listening port of the JVM SNMP agent # _jmxport 7700 ; Listening port of the Petals JMX agent # _jmxuser petals ; JMX credentials: username # _jmxpassword petals ; JMX credentials: password } #################################### #### Petals ESB as a host group #### #################################### define hostgroup { hostgroup_name petals-esb alias The ESB members petals-esb-node-1, petals-esb-node-2 } ################################## #### Petals ESB service group #### ################################## define servicegroup{ servicegroup_name petals-services alias Petals ESB Services } ################################## #### Petals ESB node services #### ################################## # Define a service to check the disk space of the partitions # Warning if < 20% free, critical if < 10% free space on partition. # Adapt the last parameter of "check_disk" to check only the # partitions where dynamic data (as log files, repository) are # written by petals (/var/lib/petals-esb, /var/log/petals-esb). # Probably two services will be required with different thresholds. define service{ use generic-service hostgroup_name petals-esb service_description Disk Space check_command check_disk!20%!10%!/var servicegroups petals-services contact_groups petals-esb } # Define a service to check the load on the 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 servicegroups petals-services contact_groups petals-esb } # 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 servicegroups petals-services contact_groups petals-esb } # 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 servicegroups petals-services contact_groups petals-esb }