testing website from multiple locations

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
MarkCampbell
Posts: 20
Joined: Tue Oct 16, 2018 4:29 pm

testing website from multiple locations

Post by MarkCampbell »

Hello,

I've created a script to perform a check_http from multiple remote nrpe servers, and it returns it all as one check. The script works, returns the same human readable data from each server, one line per, and generates an exit code based on what each server comes back with. It then takes the perf data and tacks it all at the end with different names based on the name of the server used, like this:

Code: Select all

$ ./check_http_multiserver -H www.google.com -S nagiosxi-test,nagios-test-worker,nagios-aws
nagiosxi-test returned 0: HTTP OK: HTTP/1.1 200 OK - 13779 bytes in 0.196 second response time
nagios-test-worker returned 0: HTTP OK: HTTP/1.1 200 OK - 13785 bytes in 0.216 second response time
nagios-aws returned 0: HTTP OK: HTTP/1.1 200 OK - 13752 bytes in 0.035 second response time  | time_nagiosxi-test=0.195603s;;;0.000000 size_nagiosxi-test=13779B;;;0 time_nagios-test-worker=0.216334s;;;0.000000 size_nagios-test-worker=13785B;;;0 time_nagios-aws=0.035009s;;;0.000000 size_nagios-aws=13752B;;;0
This shows up rather nicely in the human readable output, but my question comes with the differing perf data entries. I was expecting them to show up on a graph, or at least on several graphs in the performance section. But instead, the first set of data (time_nagiosxi-test & size_nagiosxi-test in my above example) shows up in the graph, and then below it there's tachometer-style gauges for each of the other performance data entries. How do I get them all to show up as graphs? Ideally as 1 graph with multiple lines, but I'll take separate graphs for each too.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: testing website from multiple locations

Post by scottwilkerson »

This is likely because you ran it once during a test and then added servers changing the number of performance metrics returned.

RRD files have a fixed number of fields determined the first time they are run and the RRD is created. You would need to delete the RRD if you change the number of metrics returned so it can create a new one

The location is

Code: Select all

/usr/local/nagios/share/perfdata/HOSTNAME/SERVICE_DESCRIPTION.rrd
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
MarkCampbell
Posts: 20
Joined: Tue Oct 16, 2018 4:29 pm

Re: testing website from multiple locations

Post by MarkCampbell »

Thanks Scott, given that this is a test box, I didn't care about the existing rrd data, so I blew away my rrd files for that host, and they started showing up. Thanks! This brings me to a question though, if at some point that I want to add another server that it is querying, but want to keep existing data, is there a way to convert the rrd data?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: testing website from multiple locations

Post by scottwilkerson »

MarkCampbell wrote:Thanks Scott, given that this is a test box, I didn't care about the existing rrd data, so I blew away my rrd files for that host, and they started showing up. Thanks! This brings me to a question though, if at some point that I want to add another server that it is querying, but want to keep existing data, is there a way to convert the rrd data?
This is possible by running the following after making the change
https://support.nagios.com/kb/article.php?id=149
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
MarkCampbell
Posts: 20
Joined: Tue Oct 16, 2018 4:29 pm

Re: testing website from multiple locations

Post by MarkCampbell »

Thanks Scott. I now have this check working out very well, and it is showing the graphs properly now.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: testing website from multiple locations

Post by scottwilkerson »

MarkCampbell wrote:Thanks Scott. I now have this check working out very well, and it is showing the graphs properly now.
Great!

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: testing website from multiple locations

Post by benjaminsmith »

Thanks Scott. I now have this check working out very well, and it is showing the graphs properly now.
Great. Shall we close this out or did you have any other questions?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!