-
Notifications
You must be signed in to change notification settings - Fork 43
Performance graphing
Hi all
If you use pnp4nagios to graph out performance data in nagios you can use this php file for the data returned by cucumber nagios
Steps
Define a nagios command that will run the cucumber-nagios feature files ( mine is called call-cucumber)
Create a php file in your pnp root/templates directory and name it the same name as the nagios command (mine is /share/pnp/templates/call-cucmber.php)
Copy this into the php file
<?php
$ds_name1 = “Step Breakdown”;
$opt1 = “—vertical-label \”Steps\" —title \“Feature tests for $hostname / $servicedesc\” ";
$def1 = "DEF:var1=$rrdfile:$DS1:AVERAGE " ;
$def1 .= “LINE1:var1#336633:\”Passed steps \" " ;
$def1 .= “GPRINT:var1:LAST:\”%3.4lg %s$UNIT1 LAST \" ";
$def1 .= “GPRINT:var1:MAX:\”%3.4lg %s$UNIT1 MAX \" ";
$def1 .= “GPRINT:var1:AVERAGE:\”%3.4lg %s$UNIT1 AVERAGE\\n\" ";
$def1 .= "DEF:var2=$rrdfile:$DS2:MAX " ;
$def1 .= “LINE1:var2#FF0000:\”Failed steps \" " ;
$def1 .= “GPRINT:var2:LAST:\”%3.4lg %s$UNIT1 LAST \" ";
$def1 .= “GPRINT:var2:MAX:\”%3.4lg %s$UNIT1 MAX \" ";
$def1 .= “GPRINT:var2:AVERAGE:\”%3.4lg %s$UNIT1 AVERAGE\\n\" ";
$def1 .= "DEF:var3=$rrdfile:$DS3:MAX " ;
$def1 .= “LINE1:var3#FFFF00:\”Skipped steps \" " ;
$def1 .= “GPRINT:var3:LAST:\”%3.4lg %s$UNIT1 LAST \" ";
$def1 .= “GPRINT:var3:MAX:\”%3.4lg %s$UNIT1 MAX \" ";
$def1 .= “GPRINT:var3:AVERAGE:\”%3.4lg %s$UNIT1 AVERAGE\\n\" ";
$def1 .= "DEF:var4=$rrdfile:$DS4:MAX " ;
$def1 .= “LINE1:var4#000066:\”Total steps \" " ;
$def1 .= “GPRINT:var4:LAST:\”%3.4lg %s$UNIT1 LAST \" ";
$def1 .= “GPRINT:var4:MAX:\”%3.4lg %s$UNIT1 MAX \" ";
$def1 .= “GPRINT:var4:AVERAGE:\”%3.4lg %s$UNIT1 AVERAGE\\n\" ";
?>