Recently had to start monitoring a confluence installation on a virtual server using Nagios. Nagios’s built-in check_http looked like it could solve my woes. Unfortunately this was a slight pain due to the fact that confluence uses a non-standard port. So I had to relearn the commands.
I edited the service check first
nano /usr/local/nagios/etc/objects/commands.cfg
I copied the check_http command into a new one:
define command {
command_name check_http_port
command_line $USER1$/check_http -I $ARG1$ -u $ARG2$ -p $ARG3$ -s $ARG4$
}
So the command would be ./check_http -I (IP/Hostname) -u (URL Full Address) -p (Port) -s (String to look for). Technically this will already warn if there is a 400 or 500 error, but I also wanted to verify that the string could be found.
Now we edit the configuration of the system itself
nano /usr/local/nagios/etc/objects/confluence.cfg
define host{
use linux-server
host_name confluence
alias confluence
address 10.555.555.555
parents parent1, switch1, mfer1
hostgroups linux-production-servers, datacenter2
}define service{
use generic-service
host_name confluence
service_description HTTP
check_command check_http_port!confluence!http://confluence:8090/login.action?os_destination=%2Fhomepage.action!8090!”Remember me”
}
Using the above check_command, you’re able to connect to the server and port listed above and check for the familiar login “remember me” string.
Thanks dude.
This helped a lot.
I have this setup for Conflence,Jira and Stash now.
One thing I did have to do was take the “‘s out of the service and put them around $ARG3$ in the command definition.
Otherwise it complained about not finding the port.
That may be because I am using puppet to manage my monitoring and it replaced the ” with ?’s around the search string in my config files.