Posts Tagged ‘nagios’

Fork of Nagios custom dashboard

I was looking for something to create custom dashboards in Nagios and came across this. The approach taken here limited each user to a single dashboard but also the method for getting the logged in user didn’t work in my environment. So I decided to fork it… My version is here. It basically contains the […]

Check a html page with check_http

With the check_http Nagios plugin we can check that a url returns an OK status code as well as verifying the page contains a certain string of text. The usage format is a s follows… ?View Code BASH/usr/local/nagios/libexec/check_http -H hostname -r search_string For example… ?View Code BASH/usr/local/nagios/libexec/check_http -H www.youdidwhatwithtsql.com -r "wordpress" If you want to make […]

Monitoring fluentd with Nagios

Here’s just a few Nagios command strings you can use to monitor fluentd. I’ve thrown in a check for elasticsearch in case you’re monitoring an EFK system. For checking td-agent. We should have 2 process, parent and child… ?View Code BASH/usr/local/nagios/libexec/check_procs -w 2:2 -C ruby -a td-agent For checking vanilla fluentd. Be aware your version name […]

Parsing Nagios log files with fluentd

Recently I’ve been experimenting with EFK to see how we can extract value from our machine logs. We also use Nagios to monitor various services and processes within our infrastructure. The text logs produces by Nagios are not very useful in their raw form as you can see… [1405413255] Auto-save of retention data completed successfully. [1405413285] […]

Linux Tip: Output error messages to syslog from cron

I wanted to find a way of running a script in cron and output the exit code, and error message, to syslog if it failed. Here’s what I came up with… ?View Code BASHoutput=`/usr/bin/scripts/test.sh 2>&1`; code=$?; if [ "$code" -ne 0 ]; then err_msg=`echo "$output" | tail -1`; logger -t "CRONERROR" "Exit Code = $code: […]