how to add DISPLAY_NAME in MRTG graph Title

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
zaji_nms
Posts: 616
Joined: Tue Oct 16, 2012 12:28 am

how to add DISPLAY_NAME in MRTG graph Title

Post by zaji_nms »

Dear Expert

I tried to add DISPLAY_NAME but failed. Appreciate your support.

File : check_xi_service_mrtgtraf.php (try to add extra field but no success)

$opt[1] = " --vertical-label \"Traffic $UNIT[1]\" -E --title \"$hostname / $servicedesc $display_name\" ";

Regards
Zajil NMS
zaji_nms
Posts: 616
Joined: Tue Oct 16, 2012 12:28 am

Re: how to add DISPLAY_NAME in MRTG graph Title

Post by zaji_nms »

able to modify the file but result is not what I was expecting , adding display_name after the service description

Nagios XI 2014R2.0

I hate new High Chart, still using old classic pnp graph. Old is gold but unable to add display_name on the title (I mean display name value(string) not appearing on the title along with service name)

Regards
Zajil NMS
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: how to add DISPLAY_NAME in MRTG graph Title

Post by sreinhardt »

Can you show us an example or screenshot of what you mean?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
cmerchant
Posts: 546
Joined: Wed Sep 24, 2014 11:19 am

Re: how to add DISPLAY_NAME in MRTG graph Title

Post by cmerchant »

it should be $HOSTDISPLAYNAME or $SERVICEDISPLAYNAME, not display_name.

Ref: http://nagios.sourceforge.net/docs/3_0/macrolist.html

unless you have created custom macros.
zaji_nms
Posts: 616
Joined: Tue Oct 16, 2012 12:28 am

Re: how to add DISPLAY_NAME in MRTG graph Title

Post by zaji_nms »

Dear Expert

from CCM, via web, in the service config , left side there is main three field/rows

Config Name*
Description*
Display Name <<<<< this $display_name (our customer link info) working fine from below little edited php

This is very simple, why NAGIOS still missing (leave it this complaint as we achieved by our Expert)

ajaxhelpers-hoststatus.inc.php
ajaxhelpers-servicestatus.inc.php
nocscreenapi.php

$output.=sorted_table_header($sortby,$sortorder,"display_name","Display Name",$extra_args,"",$url);
<td>".$service_name_cell."</td><td>".$display_name."</td><td class='".$service_status_class."

but not working from ==> check_xi_service_mrtgtraf.php

I did but no success => $opt[1] = " --vertical-label \"Traffic $UNIT[1]\" -E --title \"MRTG $hostname / $servicedesc $SERVICEDISPLAYNAME\" ";

Regards
You do not have the required permissions to view the files attached to this post.
Zajil NMS
zaji_nms
Posts: 616
Joined: Tue Oct 16, 2012 12:28 am

Re: how to add DISPLAY_NAME in MRTG graph Title

Post by zaji_nms »

Dear Expert

Need display_name in the MRTG (interface bandwidth graph) attached

Regards
You do not have the required permissions to view the files attached to this post.
Zajil NMS
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: how to add DISPLAY_NAME in MRTG graph Title

Post by abrist »

The graph title is not generated by the php, but is pulled from the rrd/pnp xml. . . I don't think this is possible, especially with the pnp graphs (there may be more options that can be edited with the highcharts graphs.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
zaji_nms
Posts: 616
Joined: Tue Oct 16, 2012 12:28 am

Re: how to add DISPLAY_NAME in MRTG graph Title

Post by zaji_nms »

Dear Abrist

me sure , title from here ==> check_xi_service_mrtgtraf.php ,, as I played with this file adding/removing some fixed string working fine but I want dynamically fetch DISPLAY_NAME (or whatsoever $SERVICEDISPLAYNAME)

I don't think we will use HighChart anytime in long or near future, this classic PNP really very very good, I like it, there is little confusion at Y-Axis values but it compensate with X-Axis.

If you check with some your colleague or can you escalate, may be possible in next upgrade.

Regards
Zajil NMS
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: how to add DISPLAY_NAME in MRTG graph Title

Post by Box293 »

Whatever is in the XML file can be referenced in the PNP graphs.

I think you are after:
$NAGIOS_DISP_HOSTNAME
or
$NAGIOS_DISP_SERVICEDESC

Use my Performance Data Tool to browse perfdata and click on one of the XML files, it will display it in a popup window.
http://exchange.nagios.org/directory/Ad ... ol/details
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
zaji_nms
Posts: 616
Joined: Tue Oct 16, 2012 12:28 am

Re: how to add DISPLAY_NAME in MRTG graph Title

Post by zaji_nms »

Dear Box293

more /usr/local/nagios/var/objects.cache | grep -i hostdisplayname <<<< Yes There is Result
more /usr/local/nagios/var/objects.cache | grep -i servicedisplayname <<< No, no result

me new to Nagios and Web/PHP programming but trying with your tips.

I tried with your suggestion to use $NAGIOS_DISP_SERVICEDESC but no success.

Regards
Zajil NMS
Locked