Category Archives: Howtos

Want to plot interval based threshold with extended warning and critical data with pnp4nagios?

Thanks to Urban Lagerström here is a great pnp4nagios php script to plot performance data from Bischeck. Deploy it on your Nagios server running pnp4nagios.

<?php
#
$opt[1] = "--title \"$hostname / $servicedesc\" ";
#
#
$def[1] = rrd::def("var1", $RRDFILE[1], $DS[1], "AVERAGE");
$def[1] .= rrd::gradient('var1','0000a0','C0C0C0','Measured ',20);
$def[1] .= rrd::gprint("var1", array("LAST", "AVERAGE", "MAX"), "%8.0lf");
$def[1] .= rrd::def("var2", $RRDFILE[1], $DS[2], "AVERAGE");
$def[1] .= rrd::line1("var2", "#000000", "Threshold ") ;
$def[1] .= rrd::gprint("var2", array("LAST", "AVERAGE", "MAX"), "%8.0lf");
$def[1] .= rrd::def("var3", $RRDFILE[1], $DS[3], "AVERAGE");
$def[1] .= rrd::def("var4", $RRDFILE[1], $DS[4], "AVERAGE");
$def[1] .= rrd::cdef("warnThresh","var2,var3,+");
$def[1] .= rrd::line1("warnThresh", "#EACC00","Warning U ");
$def[1] .= rrd::cdef("warnThreshD","var2,var3,-");
$def[1] .= rrd::line1("warnThreshD", "#FFFF00", "Warning L");
$def[1] .= rrd::gprint("var3","LAST","%8.0lf Delta\\n");
$def[1] .= rrd::cdef("critThresh","var2,var4,+");
$def[1] .= rrd::line1("critThresh", "#FEACC0","Critical U ");
$def[1] .= rrd::cdef("critThreshD","var2,var4,-");
$def[1] .= rrd::line1("critThreshD", "#FF0000", "Critical L");
$def[1] .= rrd::gprint("var4","LAST","%8.0lf Delta\\n");
?>

This will create nice graphs like the example below.

bischeck-interval-threshold

Thanks to Urban to share this solution. To see Urbans original post on IngbyForge check here.

Configuration Bischeck cache directives

Yesterday we got the following question on the mailing list that I think many others are also struggling with.

Hi,

I am trying to setup the bischeck plugin for our organization. I have configured most part of it except for the cache retention period. Here is what I want – I want to store every value which has been generated during the past 1 month. The reason being my threshold is currently calculated as the average of the metric value during the past 4 weeks at the same time of the day.

So, how do I define the cache template for this? If I don’t define any cache template, for how many days is the data kept?

Also, how does the aggregate function work and and what does the purge maxcount signify?

I’ve gone through the documentation but it wasn’t clear. Looking forward to a response.

Bischeck is one awesome plugin. Keep up the great work.  Regards, Rahul. 

It’s always great to here that someone thinks its a great product, but now back to the question.

In 1.0.0 we introduce the concept of individual cache purging and aggregations. Even if the two are related from a configuration perspective it is really two independent features. Continue reading Configuration Bischeck cache directives

Bischeck 0.4.2 performance testing

Introduction

Performance testing is key to secure that your software can handle the load and to verify the robustness of the software. With server based software, running as a daemon, it is especially important to verify that the software is stable during a long period of continues uptime without decreased throughput and by leaking resources, like memory. 

Since bischeck is designed to do advanced service check with dynamic and adaptive thresholds we know that cpu and memory will be important resources when operating with mathematical algorithms over historical collected data.

The test setup will start with a baseline that is scaled in two dimensions, increase the load by increase the number of service jobs and increase the load by decrease the interval between service job schedules.

Read the full benchmark report 

 

Bad directory location

Bischeck use the directory /var/tmp to store log files, pid file and persistent cache data. For logs this is not a bad location, but for pid file and cache data this is not a very smart location. The main reason for this are that if your bischeck process will run for a very long time, which it should, there is a risk that your pid file and cache data will be removed. This is due to the fact that distributions like Centos has a cron script that run a command tmpwatch that remove files in different “tmp” directories if files are not updated for a long time. This can be fixed by changing the cron script, /etc/cron.daily/tmpwatch on Centos or by changing the directory location by the properties in bischeck configuration file properties.xml.

The properties to change are:

  • pidfile – default is /var/tmp/bischeck.pid
  • lastStatusCacheDumpDir – default is /var/tmp/
In future release we will change the default directory location.

Manage bischeck from bisconf web

To manage the bischeck daemon from the bisconf web ui the following configuration needs to be added to the /etc/sudoers file:

Defaults:username !requiretty
nagios ALL= NOPASSWD: /etc/init.d/bischeckd restart
nagios ALL= NOPASSWD: /etc/init.d/bischeckd start
nagios ALL= NOPASSWD: /etc/init.d/bischeckd stop
nagios ALL= NOPASSWD: /etc/init.d/bischeckd pidstatus

Bisconf 0.1.0 must run on the same server as bischeck. Hopefully this may change in the future.