Page 1 of 3

selected period need to show in performance graph

Posted: Wed Feb 27, 2019 12:25 am
by zaji_nms
Dear Expert

When we view/print performance graph (rrd) (utilization or latency or temperature), it will show below on X-Axis

08:00 08:10 80:20 08:30 and so on Hour Graph
Fri Sat Sun Mon Tue Wed Weekly Graph
13 14 15 16 17 18 19 20 2-weeks graph
Week5 Week6 Week7 Week8 Monthly graph
Jan Feb Mar Apr May June yearly graph

We want to show the period we selected on X-Axis AND Y-Axis (YYYYMMDD HH:MM - YYYYMMDD HH:MM) so easily understand the graph is pulled for which period.

Regards

Re: selected period need to show in performance graph

Posted: Wed Feb 27, 2019 2:32 pm
by cdienger
This looks like it will be a feature request, but can you provide a screenshot of what you currently see so I can make sure we're on the same page?

Re: selected period need to show in performance graph

Posted: Thu Feb 28, 2019 12:50 am
by zaji_nms
dear cdienger

Please find attached.

Is there any way, if we change some code/script/template to achieve this? Please guide, give some hints. We have done many minor changes to save our time.

Regards

Re: selected period need to show in performance graph

Posted: Thu Feb 28, 2019 4:07 pm
by cdienger
I don't see an easy way to do this unfortunately. I will submit a feature request for it. I know there are plans to improve graphing in the 5.7 and 6 releases(https://www.nagios.com/roadmaps/) so perhaps it can make it in one of those.

Re: selected period need to show in performance graph

Posted: Sun Mar 03, 2019 12:55 am
by zaji_nms
dear cdienger

more /usr/local/nagios/share/pnp/templates/check_xi_service_mrtgtraf.php

#$opt[1] = " --horizontal-line \"$DISPLAY_NAME\" ";
#$def[1] .= "GPRINT:$PERIOD\ " ;

keep this above in commented option, when user need, will use this new feature (up to the user to use or not).

once again, please bring DISPLAY_NAME in front along with DESCRIPTION , its hidden

I have told many times that without Display_Name our life with Nagios was very difficult, We have customized to bring this info in Operations Centers, Host detail, Service detail, Notification, so please when you doing feature request for PERIOD to show in MRTG / RRD graph, please make sure, there is option in Template to show/print the DISPLAY_NAME

Regards

Re: selected period need to show in performance graph

Posted: Mon Mar 04, 2019 12:06 pm
by cdienger
Can you provide a copy of your check_xi_service_mrtgtraf.php as well as screenshots showing the modifications as seen in the web ui?

Re: selected period need to show in performance graph

Posted: Tue Mar 05, 2019 1:21 am
by zaji_nms
dear cdienger

in above thread I did not mention MRTG
we brought DISPLAY_NAME in front only in below four options but failed to do so in MRTG which we desperately looking forward to fix by NagiosXI Team or provide some hint so we can do via some minor change.

Operations Centers
Host detail
Service detail
Notification

MRTG

after cracking my head, I found that at least last check time can be print, but failed to format it properly

$def[1] .= "GPRINT:real2:LAST:\"%0.0lf $NAGIOS_TIMET\\n\" " ;

its showing 4 1551778710 <<<<<<< how can be remove 4 (LAST value) and how to format EPOCH time into YYYY-MMM-DD HH:MM , will give some relief


working fine
rrdtool graph dummy -s20190101 -e20190201 DEF:test=$chorchor:1:AVERAGE VDEF:B=test,LAST PRINT:B:"%c":strftime PRINT:test:MAX:'Value - %.3lf'
Thu 31 Jan 2019 11:00:00 PM AST
Value - 44.497


but while doing some trial and error.......... no luck

$def[1] .= "DEF:var2=$rrdfile:$DS[2]:AVERAGE " ;
$def[1] .= "VDEF:grphLSTtime=$rrdfile:$DS[1],LAST" ; <<<<<<<<<<<<<<<<<
$def[1] .= "CDEF:real1=var1,1,* " ;
$def[1] .= "CDEF:real2=var2,1,* " ;
$def[1] .= "GPRINT:grphLSTtime:\"%c\\n\" " ; <<<<<<<<<<<<<<

Regards

Re: selected period need to show in performance graph

Posted: Tue Mar 05, 2019 2:57 pm
by tgriep
Can you provide the full template file so we can duplicate it in a test system so we can view what the issue is?

Re: selected period need to show in performance graph

Posted: Thu Mar 07, 2019 7:38 am
by zaji_nms
dear tgriep

me able to successfully bring the value of START and LAST time via CLI as below but failed to PRINT via MRTG Template, asking help from you

rrdtool graph dummy -s20181001 -e20181007 DEF:test=$chorchor:1:MIN VDEF:F=test,FIRST VDEF:L=test,LAST PRINT:F:"%c":strftime PRINT:L:"%c":strftime PRINT:test:MAX:'Value - %.3lf'
0x0
Sun 30 Sep 2018 09:00:00 PM +03
Sun 07 Oct 2018 03:00:00 AM +03
Value - 3.897


$opt[1] = " --vertical-label \"Traffic $UNIT[1]\" -E --title \"Traffic $hostname / $servicedesc\" ";
$def[1] = "DEF:var1=$rrdfile:$DS[1]:AVERAGE " ;
$def[1] .= "DEF:var2=$rrdfile:$DS[2]:AVERAGE " ;
$def[1] .= "CDEF:real1=var1,1,* " ;
$def[1] .= "CDEF:real2=var2,1,* " ;
$def[1] .= "VDEF:zus1=var1,FIRST " ; <<<<<<<<<<<<<<< value storing is bit per second, not Time
$def[1] .= "VDEF:zus2=var1,LAST " ; <<<<<<<<<<<<<<< value storing is bit per second, not Time
$def[1] .= "LINE1:real1#003300:\"in \" " ;
$def[1] .= "GPRINT:real1:LAST:\"%7.2lf $UNIT[1] last\" " ;
$def[1] .= "GPRINT:real1:AVERAGE:\"%7.2lf $UNIT[1] avg\" " ;
$def[1] .= "GPRINT:real1:MAX:\"%7.2lf $UNIT[1] max\\n\" " ;
$def[1] .= "LINE1:real2#00ff00:\"out \" " ;
$def[1] .= "GPRINT:real2:LAST:\"%7.2lf $UNIT[1] last\" " ;
$def[1] .= "GPRINT:real2:AVERAGE:\"%7.2lf $UNIT[1] avg\" " ;
$def[1] .= "GPRINT:real2:MAX:\"%7.2lf $UNIT[1] max\\n\" ";
$def[1] .= "GPRINT:real2:LAST:\"%0.0lf $NAGIOS_TIMET \\n\" " ; <<<<<<<<<<<<<<< also don't know how to print in Time format ?
$def[1] .= "GPRINT:zus1:\"From%18.9lf \\n\" " ; <<<<<<<<< using %c useless because the stored value bps not time
$def[1] .= "GPRINT:zus2:\"To%18.9lf \\n\" " ; <<<<<<<<< using %c useless because the stored value bps not time
?>

in the command line FIRST and LAST correctly giving the From: To: time, while from the MRTG template its taking bandwidth value bit per second, how to fix to store and show as a Time not bps traffic value?

Regards

Re: selected period need to show in performance graph

Posted: Thu Mar 07, 2019 11:05 am
by tgriep
The pnp4nagios document says that the FIRST and LAST option only returns the value in data, not the time it was added which is what you are seeing as well as I.
I don't think all of the rrdgraph functions are implemented in pnp4nagios.

So far, the only thing I have gotten to work is the following example that prints out the EPOCH time of $NAGIOS_TIMET.

Code: Select all

$def[1] .= "GPRINT:real2:LAST:\"$NAGIOS_TIMET %c \\n\" " ;