Nagios Graph - Action URL to include "*%2Cdata"

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: Nagios Graph - Action URL to include "*%2Cdata"

Post by gshergill »

Hi abrist,

Was there any update on this please?

Thank you.

Kind Regards,

Gary Shergill
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Graph - Action URL to include "*%2Cdata"

Post by scottwilkerson »

I am no expert, but can't you remove the fields from the nagiosgraph config file?
http://sourceforge.net/apps/mediawiki/n ... ntation.3F
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: Nagios Graph - Action URL to include "*%2Cdata"

Post by gshergill »

Hi scottwilkerson,

Thank you for the link, very informative.

I thought I had it figured out by going to the file datasetdb.conf and changing some stuff.

By default the following is in the file:

Code: Select all

# dataset options for nagiosgraph
#
# This file lists the default databases and sources that should be selected
# for each service.  If no databases or sources are defined here for
# a service, then all sources for all databases for that service will be
# selected by default.
#
# The format for each line is:
#
# service=name&db=database[,ds-name][&db=database[,ds-name][...]]
#
# This file is optional.
#
# These are examples.  Customize them to suit your configuration.

service=Current Load&db=load1,data&db=load5,data&db=load15,data&db=load1,warn,crit
service=Current Users&db=users,data,warn,crit
service=Disk Space&db=/,data,warn,crit&db=/home,data,warn,crit&db=/var,data,warn,crit
service=HTTP&db=time,data
service=PING&db=rta,data,warn,crit
service=Root Partition&db=/,data,warn,crit
service=Swap Usage&db=swap,data,warn,crit
So I figured I'd test it by changing a line:

Code: Select all

service=Root Partition&db=/,data,warn,crit
to

Code: Select all

service=Root Partition&db=/,data
#,warn,crit
I then removed the old .rrd for that service on localhost and restarted nagios, but I can still see warning, critical, maximum and minimum.

I'll read through again, I'm pretty sure I'm in the wrong place (because I can't see maximum and minimum for root partition in the file).

Thank you.

Kind Regards,

Gary Shergill
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Graph - Action URL to include "*%2Cdata"

Post by scottwilkerson »

If you do figure this out please post your findings...

thanks
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: Nagios Graph - Action URL to include "*%2Cdata"

Post by gshergill »

Hi,

So I've been playing around with this in my spare time trying to get it working, and by the looks of it all I can find is ways to actually remove all warn, crit, max, min data from being collected, whereas I simply want the graph to only display data from the link, with the option to show more if you want to.

Currently I have just created templates for each service type that is being graphed, but that is getting a bit messy.

I was using "notes" and having the web url include $SERVICENOTES$ before the %2data, but then the webpage was showing the note when you click the service.
Is there a way to either hide notes from the webpage, or another service object I can define which won't appear there but could be used for this?

Thank you.

Kind Regards,

Gary Shergill

Note: I'll still look for a way to produce a separate graph for data which I will point the link to, but to be honest I don't think having duplicate graphs is a viable implementation.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Graph - Action URL to include "*%2Cdata"

Post by scottwilkerson »

As much as I wish I could help you would likely get better response from the makers of NagiosGraph
http://sourceforge.net/projects/nagiosgraph/support
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: Nagios Graph - Action URL to include "*%2Cdata"

Post by gshergill »

Hi scottwilkerson,

I posted there a while ago but there hasn't been a response yet, I don't think it's very active.

Regarding my other question, is there a way to remove "Notes" from being displayed in the web page when you click on a service?

Thank you.

Kind Regards,

Gary Shergill
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios Graph - Action URL to include "*%2Cdata"

Post by abrist »

gshergill wrote:Regarding my other question, is there a way to remove "Notes" from being displayed in the web page when you click on a service?
Are the notes appearing just in core, or in XI as well? Are you using the "Action URL" component? If so, you may be able to turn off the action and notes url in the that component.
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.
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: Nagios Graph - Action URL to include "*%2Cdata"

Post by gshergill »

Hi abrist,

I've defined my service as follows:

Code: Select all

define service{
        use                     generic-service,graphed-service         ; Name of service template to use
        hostgroup_name          linux_servers, windows_servers, esxi_servers, asterisk_servers
        service_description     PING
        check_command           check_ping!100.0,20%!500.0,60%
        notes                   rta
        }
On just my core server I go to the webpage and click on the ping service from one of the hosts.

It shows on the web page the basic information in the corner, and in the centre shows:
Service
PING
On Host
<hostname>
(<alias>)

Member of
No servicegroups.

<ip address>

rta
Under rta is the service state information and service commands as normal.

Ideally, I would like to remove the rta from the webpage? I'm using "notes" to define the type of data for the service as a workaround for showing the correct graphs until I can find a more permanent solution.

Code: Select all

define service {
        name withgraphs-service
        action_url /nagios/cgi-bin/show.cgi?host=$HOSTNAME$&service=$SERVICEDESC$&expand_period=day,week&geom=1000x200&db=$SERVICENOTES$%2Cdata' onMouseOver='showGraphPopup(this)' onMouseOut='hideGraphPopup()' rel='/nagiosgraph/cgi-bin/showgraph.cgi?host=$HOSTNAME$&service=$SERVICEDESC$&period=week&rrdopts=-w+450+-j
        register 0
}


Thank you.

Kind Regards,

Gary Shergill
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios Graph - Action URL to include "*%2Cdata"

Post by abrist »

The table that contains the "notes" is generated from the CGIs. You would want to edit the file ../nagios/cgi/extinfo.c in the nagios core source. Search for notes. You should find a pair of notes each in the four conditionals for service/host/servicegroups/hostgroups (around line 380). It will look like:

Code: Select all

                        if(display_type == DISPLAY_SERVICE_INFO) {
                                if(temp_service->icon_image != NULL) {
                                        printf("<img src='%s", url_logo_images_path);
                                        process_macros_r(mac, temp_service->icon_image, &processed_string, 0);
                                        printf("%s", processed_string);
                                        free(processed_string);
                                        printf("' border=0 alt='%s' title='%s'><BR CLEAR=ALL>", (temp_service->icon_image_alt == NULL) ? "" : temp_service->icon_image_alt, (temp_service->icon_image_alt == NULL) ? "" : temp_service->icon_image_alt);
                                        }
                                if(temp_service->icon_image_alt != NULL)
                                        printf("<font size=-1><i>( %s )</i></font>\n", temp_service->icon_image_alt);
                                if(temp_service->notes != NULL) {
                                        process_macros_r(mac, temp_service->notes, &processed_string, 0);
                                        printf("<p>%s</p>\n", processed_string);
                                        free(processed_string);
                                        }
                                }
Comment out the following or disable as you see fit:

Code: Select all

                                if(temp_service->notes != NULL) {
                                        process_macros_r(mac, temp_service->notes, &processed_string, 0);
                                        printf("<p>%s</p>\n", processed_string);
                                        free(processed_string);
                                        }
Repeat for the other 3 sections, save out, recompile it, move it over into your cgi directory (rename the old cgi), and give it a go.
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.
Locked