## check_p4 : A Nagios check command for Perforce. ## This script is intended to be used as a Nagios check command. It reports on whether a Perforce Server is running, and will warn or error if the license of SSL certificates will expire within a specified number of days. ## Installation ## Ensure that Ruby and P4Ruby are installed. Move 'check_p4.rb' to /usr/local/lib/nagios/plugins/check_p4.rb'. If this is the Nagios host, move 'p4.cfg' to '/etc/nagios-plugins/config/p4.cfg'. You can then utilise the check by adding a service to a host. For example: define service { use generic-service host_name ${name} service_description Perforce Server check_command check_p4!1666 } Alternatively, if check_p4 is to be called from NRPE, create a file in '/etc/nagios/nrpe.d/' that calls check_p4.rb. For example: /etc/nagios/nrpe.d/p4_checks.cfg command[check_p4_ssl]=/usr/local/lib/nagios/plugins/check_p4.rb -H localhost -p 1666 --ssl On the Nagios server, a check_nrpe service can be added to a host to call the check_p4_ssl command defined in that file. For example: define service { use generic-service host_name ${name} service_description Perforce Server check_command check_nrpe_1arg!check_main_p4 } ## Command Arguments ## * -H hostname The hostname of the Perforce Server to connect to * -p port_number The port number that the Perforce Server is listening on * --ssl Specify this if the Perforce Server is using SSL * -u p4user This is the username provided when check_p4.rb runs 'p4 info' * -c critical_threshold_days If license or any SSL certificates would expire within this number of days, the service will report critical * -w warn_threshold_days If license or any SSL certificates would expire within this number of days, the service will report warning ## Support Disclaimer ## User contributed content on the Perforce Public Depot is not supported by Perforce, although it may be supported by its author. This applies to all contributions even those submitted by Perforce employees.