A couple hours later, and still no graph in xymon. Ssl_error_log yields:
[Tue Sep 10 11:01:36 2019] [error] [client 10.139.63.193] Premature end of script headers: showgraph.sh, referer: https://xymon.corp.intranet/xymon-cgi/svcstatus.sh?HOST=nsmdenvp185&SERVICE=...
The manual graph is still getting more data in, using the exact same definitions as in graphs.cfg.
From: Root, Paul T Sent: Tuesday, September 10, 2019 9:09 AM To: 'Jeremy Laidman' <jeremy at laidman.org> Cc: Japheth Cleaver <cleaver at terabithia.org>; Ralph Mitchell <ralphmitchell at gmail.com>; xymon at xymon.com Subject: RE: [Xymon] Graphing in Xymon
Excellent, that?s probably the key.
I?ve made the change, I?m guessing I need a new input before anything can work.
rrdtool tune ConfigPulls.rrd -h NetAtoD:86400 -h NetEtoN:86400 -h NetOtoZ1to9:86400 -h Other:86400 -h InfraGen:86400 -h InfraSec:86400
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE rrd SYSTEM "http://oss.oetiker.ch/rrdtool/rrdtool.dtd"> <!-- Round Robin Database Dump --><rrd> <version> 0003 </version> <step> 300 </step> <!-- Seconds --> <lastupdate> 1568123701 </lastupdate> <!-- 2019-09-10 08:55:01 CDT -->
<ds>
<name> NetAtoD </name>
<type> GAUGE </type>
<minimal_heartbeat> 86400 </minimal_heartbeat>
<min> NaN </min>
<max> NaN </max>
<!-- PDP Status -->
<last_ds> 167 </last_ds>
<value> NaN </value>
<unknown_sec> 1 </unknown_sec>
</ds>
Impatient as I am, I manually ran the script again, and then ran the rrdtool graph, and I got data points on the graph. So I should be close now.
Thanks, Paul.
From: Jeremy Laidman <jeremy at laidman.org<mailto:jeremy at laidman.org>> Sent: Tuesday, September 10, 2019 8:38 AM To: Root, Paul T <Paul.Root at CenturyLink.com<mailto:Paul.Root at CenturyLink.com>> Cc: Japheth Cleaver <cleaver at terabithia.org<mailto:cleaver at terabithia.org>>; Ralph Mitchell <ralphmitchell at gmail.com<mailto:ralphmitchell at gmail.com>>; xymon at xymon.com<mailto:xymon at xymon.com> Subject: Re: [Xymon] Graphing in Xymon
"ds[NetAtoD].minimal_heartbeat = 600"
Isn't the minimal_heartbeat setting for telling RRD to discard samples that exist on their own? I think the idea is that it doesn't make sense to calculate values from DERIVE or COUNTER inputs. From the man page for rrdcreate:
<The "heartbeat" defines the maximum acceptable interval between samples/updates. If the interval between samples is less than "heartbeat", then an average rate is calculated and applied for that interval. If the interval between samples is longer than "heartbeat", then that entire interval is considered "unknown".>
If you're sampling once per hour, then every sample will exceed the 600 second heartbeat. So you might need to re-create (or rrdtune) your RRD file and increase the mimimal_heartbeat value.
And from the man page for rrdtune:
<--heartbeat|-h ds-name:heartbeat modify the heartbeat of a data source. By setting this to a high value the RRD will accept things like one value per day.>
J
This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
I thing RRD needs two or more consecutive data points before it produces results. If you add more than one within a timeslot, it rejects the second and subsequent ones. If you've configured your RRD file to work on an hourly basis, you need to wait 2-3 hours.
On Wed, 11 Sep 2019 at 02:07, Root, Paul T <Paul.Root at centurylink.com> wrote:
A couple hours later, and still no graph in xymon. Ssl_error_log yields:
[Tue Sep 10 11:01:36 2019] [error] [client 10.139.63.193] Premature end of script headers: showgraph.sh, referer: https://xymon.corp.intranet/xymon-cgi/svcstatus.sh?HOST=nsmdenvp185&SERVICE=...
The manual graph is still getting more data in, using the exact same definitions as in graphs.cfg.
*From:* Root, Paul T *Sent:* Tuesday, September 10, 2019 9:09 AM *To:* 'Jeremy Laidman' <jeremy at laidman.org> *Cc:* Japheth Cleaver <cleaver at terabithia.org>; Ralph Mitchell < ralphmitchell at gmail.com>; xymon at xymon.com *Subject:* RE: [Xymon] Graphing in Xymon
Excellent, that?s probably the key.
I?ve made the change, I?m guessing I need a new input before anything can work.
rrdtool tune ConfigPulls.rrd -h NetAtoD:86400 -h NetEtoN:86400 -h NetOtoZ1to9:86400 -h Other:86400 -h InfraGen:86400 -h InfraSec:86400
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rrd SYSTEM "http://oss.oetiker.ch/rrdtool/rrdtool.dtd">
<!-- Round Robin Database Dump --><rrd> <version> 0003 </version>
<step> 300 </step> <!-- Seconds --> <lastupdate> 1568123701 </lastupdate> <!-- 2019-09-10 08:55:01CDT -->
<ds> <name> NetAtoD </name> <type> GAUGE </type> <minimal_heartbeat> 86400 </minimal_heartbeat> <min> NaN </min> <max> NaN </max> <!-- PDP Status --> <last_ds> 167 </last_ds> <value> NaN </value> <unknown_sec> 1 </unknown_sec> </ds>Impatient as I am, I manually ran the script again, and then ran the rrdtool graph, and I got data points on the graph. So I should be close now.
Thanks,
Paul.
*From:* Jeremy Laidman <jeremy at laidman.org> *Sent:* Tuesday, September 10, 2019 8:38 AM *To:* Root, Paul T <Paul.Root at CenturyLink.com> *Cc:* Japheth Cleaver <cleaver at terabithia.org>; Ralph Mitchell < ralphmitchell at gmail.com>; xymon at xymon.com *Subject:* Re: [Xymon] Graphing in Xymon
"ds[NetAtoD].minimal_heartbeat = 600"
Isn't the minimal_heartbeat setting for telling RRD to discard samples that exist on their own? I think the idea is that it doesn't make sense to calculate values from DERIVE or COUNTER inputs. From the man page for rrdcreate:
<*The "heartbeat" defines the maximum acceptable interval between samples/updates. If the interval between samples is less than "heartbeat", then an average rate is calculated and applied for that interval. If the interval between samples is longer than "heartbeat", then that entire interval is considered "unknown".*>
If you're sampling once per hour, then every sample will exceed the 600 second heartbeat. So you might need to re-create (or rrdtune) your RRD file and increase the mimimal_heartbeat value.
And from the man page for rrdtune:
<*--heartbeat**|-h ds-name:heartbeat *
*modify the heartbeat of a data source. By setting this to a high value the **RRD will accept things like one value per day.*>
J
This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
Looking this morning. There is no change, no graph.
Manually making the graph works perfectly.
From: Jeremy Laidman <jeremy at laidman.org> Sent: Tuesday, September 10, 2019 11:46 AM To: Root, Paul T <Paul.Root at CenturyLink.com> Cc: Japheth Cleaver <cleaver at terabithia.org>; Ralph Mitchell <ralphmitchell at gmail.com>; xymon at xymon.com Subject: Re: [Xymon] Graphing in Xymon
I thing RRD needs two or more consecutive data points before it produces results. If you add more than one within a timeslot, it rejects the second and subsequent ones. If you've configured your RRD file to work on an hourly basis, you need to wait 2-3 hours.
On Wed, 11 Sep 2019 at 02:07, Root, Paul T <Paul.Root at centurylink.com<mailto:Paul.Root at centurylink.com>> wrote: A couple hours later, and still no graph in xymon. Ssl_error_log yields:
[Tue Sep 10 11:01:36 2019] [error] [client 10.139.63.193] Premature end of script headers: showgraph.sh, referer: https://xymon.corp.intranet/xymon-cgi/svcstatus.sh?HOST=nsmdenvp185&SERVICE=...
The manual graph is still getting more data in, using the exact same definitions as in graphs.cfg.
From: Root, Paul T Sent: Tuesday, September 10, 2019 9:09 AM To: 'Jeremy Laidman' <jeremy at laidman.org<mailto:jeremy at laidman.org>> Cc: Japheth Cleaver <cleaver at terabithia.org<mailto:cleaver at terabithia.org>>; Ralph Mitchell <ralphmitchell at gmail.com<mailto:ralphmitchell at gmail.com>>; xymon at xymon.com<mailto:xymon at xymon.com> Subject: RE: [Xymon] Graphing in Xymon
Excellent, that?s probably the key.
I?ve made the change, I?m guessing I need a new input before anything can work.
rrdtool tune ConfigPulls.rrd -h NetAtoD:86400 -h NetEtoN:86400 -h NetOtoZ1to9:86400 -h Other:86400 -h InfraGen:86400 -h InfraSec:86400
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE rrd SYSTEM "http://oss.oetiker.ch/rrdtool/rrdtool.dtd"> <!-- Round Robin Database Dump --><rrd> <version> 0003 </version> <step> 300 </step> <!-- Seconds --> <lastupdate> 1568123701 </lastupdate> <!-- 2019-09-10 08:55:01 CDT -->
<ds>
<name> NetAtoD </name>
<type> GAUGE </type>
<minimal_heartbeat> 86400 </minimal_heartbeat>
<min> NaN </min>
<max> NaN </max>
<!-- PDP Status -->
<last_ds> 167 </last_ds>
<value> NaN </value>
<unknown_sec> 1 </unknown_sec>
</ds>
Impatient as I am, I manually ran the script again, and then ran the rrdtool graph, and I got data points on the graph. So I should be close now.
Thanks, Paul.
From: Jeremy Laidman <jeremy at laidman.org<mailto:jeremy at laidman.org>> Sent: Tuesday, September 10, 2019 8:38 AM To: Root, Paul T <Paul.Root at CenturyLink.com<mailto:Paul.Root at CenturyLink.com>> Cc: Japheth Cleaver <cleaver at terabithia.org<mailto:cleaver at terabithia.org>>; Ralph Mitchell <ralphmitchell at gmail.com<mailto:ralphmitchell at gmail.com>>; xymon at xymon.com<mailto:xymon at xymon.com> Subject: Re: [Xymon] Graphing in Xymon
"ds[NetAtoD].minimal_heartbeat = 600"
Isn't the minimal_heartbeat setting for telling RRD to discard samples that exist on their own? I think the idea is that it doesn't make sense to calculate values from DERIVE or COUNTER inputs. From the man page for rrdcreate:
<The "heartbeat" defines the maximum acceptable interval between samples/updates. If the interval between samples is less than "heartbeat", then an average rate is calculated and applied for that interval. If the interval between samples is longer than "heartbeat", then that entire interval is considered "unknown".>
If you're sampling once per hour, then every sample will exceed the 600 second heartbeat. So you might need to re-create (or rrdtune) your RRD file and increase the mimimal_heartbeat value.
And from the man page for rrdtune:
<--heartbeat|-h ds-name:heartbeat modify the heartbeat of a data source. By setting this to a high value the RRD will accept things like one value per day.>
J
This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
Looping back on this:
Running the showgraph by hand
$ ./showgraph.sh host=nsmdenvp185 service=ncv:ConfigPulls graph_width=576 graph_height=120 disp=nsmdenvp185 nostale color=blue graph_start=1568489816 graph_end=1568662616 graph=hourly action=view
Content-type: text/html
<html><head><title>Invalid request</title></head> <body>Invalid request - no host or service</body></html>
$ ls /var/lib/xymon/rrd/nsmdenvp185/ConfigPulls* /var/lib/xymon/rrd/nsmdenvp185/ConfigPulls.rrd root nsmdenvp117:/usr/lib64/xymon/cgi-bin $ cat ~ptroot/crap2 #!/bin/bash
$ curl -k https://nsmdenvp117.corp.intranet/xymon-cgi/showgraph.sh\?host=nsmdenvp185\&service=ncv:ConfigPulls\&graph_width=576\&graph_height=120\&disp=nsmdenvp185\&nostale\&color=blue\&graph_start=1568489816\&graph_end=1568662616\&graph=hourly\&action=view <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>500 Internal Server Error</title> </head><body> <h1>Internal Server Error</h1> <p>The server encountered an internal error or misconfiguration and was unable to complete your request.</p> <p>Please contact the server administrator, ms2sys at CenturyLink.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.</p> <p>More information about this error may be available in the server error log.</p> <hr> <address>Apache/2.2.15 (CentOS) Server at nsmdenvp117.corp.intranet Port 443</address> </body></html>
Again, if I run rrdtool graph by hand, I get a good graph..
Could this be the Test name is too long for showgraph, or maybe doesn?t like mixed case?
From: Xymon <xymon-bounces at xymon.com> On Behalf Of Root, Paul T Sent: Wednesday, September 11, 2019 8:26 AM To: 'Jeremy Laidman' <jeremy at laidman.org> Cc: xymon at xymon.com Subject: Re: [Xymon] Graphing in Xymon
Looking this morning. There is no change, no graph.
Manually making the graph works perfectly.
From: Jeremy Laidman <jeremy at laidman.org<mailto:jeremy at laidman.org>> Sent: Tuesday, September 10, 2019 11:46 AM To: Root, Paul T <Paul.Root at CenturyLink.com<mailto:Paul.Root at CenturyLink.com>> Cc: Japheth Cleaver <cleaver at terabithia.org<mailto:cleaver at terabithia.org>>; Ralph Mitchell <ralphmitchell at gmail.com<mailto:ralphmitchell at gmail.com>>; xymon at xymon.com<mailto:xymon at xymon.com> Subject: Re: [Xymon] Graphing in Xymon
I thing RRD needs two or more consecutive data points before it produces results. If you add more than one within a timeslot, it rejects the second and subsequent ones. If you've configured your RRD file to work on an hourly basis, you need to wait 2-3 hours.
On Wed, 11 Sep 2019 at 02:07, Root, Paul T <Paul.Root at centurylink.com<mailto:Paul.Root at centurylink.com>> wrote: A couple hours later, and still no graph in xymon. Ssl_error_log yields:
[Tue Sep 10 11:01:36 2019] [error] [client 10.139.63.193] Premature end of script headers: showgraph.sh, referer: https://xymon.corp.intranet/xymon-cgi/svcstatus.sh?HOST=nsmdenvp185&SERVICE=...
The manual graph is still getting more data in, using the exact same definitions as in graphs.cfg.
From: Root, Paul T Sent: Tuesday, September 10, 2019 9:09 AM To: 'Jeremy Laidman' <jeremy at laidman.org<mailto:jeremy at laidman.org>> Cc: Japheth Cleaver <cleaver at terabithia.org<mailto:cleaver at terabithia.org>>; Ralph Mitchell <ralphmitchell at gmail.com<mailto:ralphmitchell at gmail.com>>; xymon at xymon.com<mailto:xymon at xymon.com> Subject: RE: [Xymon] Graphing in Xymon
Excellent, that?s probably the key.
I?ve made the change, I?m guessing I need a new input before anything can work.
rrdtool tune ConfigPulls.rrd -h NetAtoD:86400 -h NetEtoN:86400 -h NetOtoZ1to9:86400 -h Other:86400 -h InfraGen:86400 -h InfraSec:86400
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE rrd SYSTEM "http://oss.oetiker.ch/rrdtool/rrdtool.dtd"> <!-- Round Robin Database Dump --><rrd> <version> 0003 </version> <step> 300 </step> <!-- Seconds --> <lastupdate> 1568123701 </lastupdate> <!-- 2019-09-10 08:55:01 CDT -->
<ds>
<name> NetAtoD </name>
<type> GAUGE </type>
<minimal_heartbeat> 86400 </minimal_heartbeat>
<min> NaN </min>
<max> NaN </max>
<!-- PDP Status -->
<last_ds> 167 </last_ds>
<value> NaN </value>
<unknown_sec> 1 </unknown_sec>
</ds>
Impatient as I am, I manually ran the script again, and then ran the rrdtool graph, and I got data points on the graph. So I should be close now.
Thanks, Paul.
From: Jeremy Laidman <jeremy at laidman.org<mailto:jeremy at laidman.org>> Sent: Tuesday, September 10, 2019 8:38 AM To: Root, Paul T <Paul.Root at CenturyLink.com<mailto:Paul.Root at CenturyLink.com>> Cc: Japheth Cleaver <cleaver at terabithia.org<mailto:cleaver at terabithia.org>>; Ralph Mitchell <ralphmitchell at gmail.com<mailto:ralphmitchell at gmail.com>>; xymon at xymon.com<mailto:xymon at xymon.com> Subject: Re: [Xymon] Graphing in Xymon
"ds[NetAtoD].minimal_heartbeat = 600"
Isn't the minimal_heartbeat setting for telling RRD to discard samples that exist on their own? I think the idea is that it doesn't make sense to calculate values from DERIVE or COUNTER inputs. From the man page for rrdcreate:
<The "heartbeat" defines the maximum acceptable interval between samples/updates. If the interval between samples is less than "heartbeat", then an average rate is calculated and applied for that interval. If the interval between samples is longer than "heartbeat", then that entire interval is considered "unknown".>
If you're sampling once per hour, then every sample will exceed the 600 second heartbeat. So you might need to re-create (or rrdtune) your RRD file and increase the mimimal_heartbeat value.
And from the man page for rrdtune:
<--heartbeat|-h ds-name:heartbeat modify the heartbeat of a data source. By setting this to a high value the RRD will accept things like one value per day.>
J
This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
On Tue, 17 Sep 2019 at 05:53, Root, Paul T <Paul.Root at centurylink.com> wrote:
Looping back on this:
Running the showgraph by hand
$ *./showgraph.sh host=nsmdenvp185 service=ncv:ConfigPulls graph_width=576 graph_height=120 disp=nsmdenvp185 nostale color=blue graph_start=1568489816 graph_end=1568662616 graph=hourly action=view*
This won't work. The showgraph.cgi binary expects to be run as a CGI and requires QUERY_STRING to be set (to host=nsmdenvp185&service=ncv:ConfigPulls&graph_width=...) and REQUEST_MATHOD to be set to "GET". It also expects SCRIPT_NAME to be set (and normally it would be showgraph.sh) but I think this only generates warnings.
Try running like so:
SCRIPT_NAME=showgraph.sh REQUEST_METHOD=GET QUERY_STRING='host=nsmdenvp185&service=ncv:ConfigPulls&graph_width=576&graph_height=120&disp=nsmdenvp185&nostale&color=blue&graph_start=1568489816&graph_end=1568662616&graph=hourly&action=view' ./showgraph.sh
The output will be partly binary, so you might want to try:
SCRIPT_NAME=showgraph.sh REQUEST_METHOD=GET QUERY_STRING='host=nsmdenvp185&service=ncv:ConfigPulls&graph_width=576&graph_height=120&disp=nsmdenvp185&nostale&color=blue&graph_start=1568489816&graph_end=1568662616&graph=hourly&action=view' ./showgraph.sh | sed '1,/^$/d' | file -
and see if it shows that a PNG file format was generated.
If this doesn't work, check for a service name such as "cpu" that is known to work, rather than your custom "ncv:ConfigPulls".
Content-type: text/html
<html><head><title>Invalid request</title></head>
<body>Invalid request - no host or service</body></html>
Yep, cos no QUERY_STRING.
$ *ls /var/lib/xymon/rrd/nsmdenvp185/ConfigPulls**
/var/lib/xymon/rrd/nsmdenvp185/ConfigPulls.rrd
root nsmdenvp117:/usr/lib64/xymon/cgi-bin
$ cat ~ptroot/crap2
#!/bin/bash
$* curl -k https://nsmdenvp117.corp.intranet/xymon-cgi/showgraph.sh\?host=nsmdenvp185\&service=ncv:ConfigPulls\&graph_width=576\&graph_height=120\&disp=nsmdenvp185\&nostale\&color=blue\&graph_start=1568489816\&graph_end=1568662616\&graph=hourly\&action=view <https://nsmdenvp117.corp.intranet/xymon-cgi/showgraph.sh%5C?host=nsmdenvp185%5C&service=ncv:ConfigPulls%5C&graph_width=576%5C&graph_height=120%5C&disp=nsmdenvp185%5C&nostale%5C&color=blue%5C&graph_start=1568489816%5C&graph_end=1568662616%5C&graph=hourly%5C&action=view>*
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
This works for me (substituting my own Xymon servername, hostname and service.
</head><body>
<h1>Internal Server Error</h1>
Check your Apache/webserver logs for the cause.
Again, if I run rrdtool graph by hand, I get a good graph..
Could this be the Test name is too long for showgraph, or maybe doesn?t like mixed case?
I don't think so. I have a graph that shows with "service=bind9-stats-extended" which is longer than your "nsv:ConfigPulls" including the prefix.
J
*From:* Xymon <xymon-bounces at xymon.com> *On Behalf Of *Root, Paul T *Sent:* Wednesday, September 11, 2019 8:26 AM *To:* 'Jeremy Laidman' <jeremy at laidman.org> *Cc:* xymon at xymon.com *Subject:* Re: [Xymon] Graphing in Xymon
Looking this morning. There is no change, no graph.
Manually making the graph works perfectly.
*From:* Jeremy Laidman <jeremy at laidman.org> *Sent:* Tuesday, September 10, 2019 11:46 AM *To:* Root, Paul T <Paul.Root at CenturyLink.com> *Cc:* Japheth Cleaver <cleaver at terabithia.org>; Ralph Mitchell < ralphmitchell at gmail.com>; xymon at xymon.com *Subject:* Re: [Xymon] Graphing in Xymon
I thing RRD needs two or more consecutive data points before it produces results. If you add more than one within a timeslot, it rejects the second and subsequent ones. If you've configured your RRD file to work on an hourly basis, you need to wait 2-3 hours.
On Wed, 11 Sep 2019 at 02:07, Root, Paul T <Paul.Root at centurylink.com> wrote:
A couple hours later, and still no graph in xymon. Ssl_error_log yields:
[Tue Sep 10 11:01:36 2019] [error] [client 10.139.63.193] Premature end of script headers: showgraph.sh, referer: https://xymon.corp.intranet/xymon-cgi/svcstatus.sh?HOST=nsmdenvp185&SERVICE=...
The manual graph is still getting more data in, using the exact same definitions as in graphs.cfg.
*From:* Root, Paul T *Sent:* Tuesday, September 10, 2019 9:09 AM *To:* 'Jeremy Laidman' <jeremy at laidman.org> *Cc:* Japheth Cleaver <cleaver at terabithia.org>; Ralph Mitchell < ralphmitchell at gmail.com>; xymon at xymon.com *Subject:* RE: [Xymon] Graphing in Xymon
Excellent, that?s probably the key.
I?ve made the change, I?m guessing I need a new input before anything can work.
rrdtool tune ConfigPulls.rrd -h NetAtoD:86400 -h NetEtoN:86400 -h NetOtoZ1to9:86400 -h Other:86400 -h InfraGen:86400 -h InfraSec:86400
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rrd SYSTEM "http://oss.oetiker.ch/rrdtool/rrdtool.dtd">
<!-- Round Robin Database Dump --><rrd> <version> 0003 </version>
<step> 300 </step> <!-- Seconds --> <lastupdate> 1568123701 </lastupdate> <!-- 2019-09-10 08:55:01 CDT-->
<ds> <name> NetAtoD </name> <type> GAUGE </type> <minimal_heartbeat> 86400 </minimal_heartbeat> <min> NaN </min> <max> NaN </max> <!-- PDP Status --> <last_ds> 167 </last_ds> <value> NaN </value> <unknown_sec> 1 </unknown_sec> </ds>Impatient as I am, I manually ran the script again, and then ran the rrdtool graph, and I got data points on the graph. So I should be close now.
Thanks,
Paul.
*From:* Jeremy Laidman <jeremy at laidman.org> *Sent:* Tuesday, September 10, 2019 8:38 AM *To:* Root, Paul T <Paul.Root at CenturyLink.com> *Cc:* Japheth Cleaver <cleaver at terabithia.org>; Ralph Mitchell < ralphmitchell at gmail.com>; xymon at xymon.com *Subject:* Re: [Xymon] Graphing in Xymon
"ds[NetAtoD].minimal_heartbeat = 600"
Isn't the minimal_heartbeat setting for telling RRD to discard samples that exist on their own? I think the idea is that it doesn't make sense to calculate values from DERIVE or COUNTER inputs. From the man page for rrdcreate:
<*The "heartbeat" defines the maximum acceptable interval between samples/updates. If the interval between samples is less than "heartbeat", then an average rate is calculated and applied for that interval. If the interval between samples is longer than "heartbeat", then that entire interval is considered "unknown".*>
If you're sampling once per hour, then every sample will exceed the 600 second heartbeat. So you might need to re-create (or rrdtune) your RRD file and increase the mimimal_heartbeat value.
And from the man page for rrdtune:
<*--heartbeat**|-h ds-name:heartbeat *
*modify the heartbeat of a data source. By setting this to a high value the **RRD will accept things like one value per day.*>
J
This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
I must be doing something group here, neither worked:
$ SCRIPT_NAME=showgraph.sh REQUEST_METHOD=GET root nsmdenvp117:/etc/xymon/analysis.d $ QUERY_STRING='host=nsmdenvp185&service=ncv:ConfigPulls&graph_width=576&graph_height=120&disp=nsmdenvp185&nostale&color=blue&graph_start=1568489816&graph_end=1568662616&graph=hourly&action=view' $ PATH=$PATH:/usr/lib64/xymon/cgi-bin $ type showgraph.sh showgraph.sh is /usr/lib64/xymon/cgi-bin/showgraph.sh $ showgraph.sh Content-type: text/html
<html><head><title>Invalid request</title></head> <body>Invalid request - no host or service</body></html> $ export QUERY_STRING $ export SCRIPTNAME $ $SCRIPTNAME $ export SCRIPT_NAME $ $SCRIPT_NAME Content-type: text/html
<html><head><title>Invalid request</title></head> <body>Invalid request - no host or service</body></html> $ QUERY_STRING='host=nsmdenvp185&service=cpu&graph_width=576&graph_height=120&disp=nsmdenvp185&nostale&color=blue&graph_start=1568489816&graph_end=1568662616&graph=hourly&action=view' $ $SCRIPT_NAME Content-type: text/html
<html><head><title>Invalid request</title></head> <body>Invalid request - no host or service</body></html> $ file /usr/lib64/xymon/cgi-bin/showgraph.sh /usr/lib64/xymon/cgi-bin/showgraph.sh: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
From: Jeremy Laidman <jeremy at laidman.org> Sent: Monday, September 16, 2019 3:38 PM To: Root, Paul T <Paul.Root at CenturyLink.com> Cc: xymon at xymon.com Subject: Re: [Xymon] Graphing in Xymon
On Tue, 17 Sep 2019 at 05:53, Root, Paul T <Paul.Root at centurylink.com<mailto:Paul.Root at centurylink.com>> wrote: Looping back on this:
Running the showgraph by hand
$ ./showgraph.sh host=nsmdenvp185 service=ncv:ConfigPulls graph_width=576 graph_height=120 disp=nsmdenvp185 nostale color=blue graph_start=1568489816 graph_end=1568662616 graph=hourly action=view
This won't work. The showgraph.cgi binary expects to be run as a CGI and requires QUERY_STRING to be set (to host=nsmdenvp185&service=ncv:ConfigPulls&graph_width=...) and REQUEST_MATHOD to be set to "GET". It also expects SCRIPT_NAME to be set (and normally it would be showgraph.sh) but I think this only generates warnings.
Try running like so:
SCRIPT_NAME=showgraph.sh REQUEST_METHOD=GET QUERY_STRING='host=nsmdenvp185&service=ncv:ConfigPulls&graph_width=576&graph_height=120&disp=nsmdenvp185&nostale&color=blue&graph_start=1568489816&graph_end=1568662616&graph=hourly&action=view' ./showgraph.sh
The output will be partly binary, so you might want to try:
SCRIPT_NAME=showgraph.sh REQUEST_METHOD=GET QUERY_STRING='host=nsmdenvp185&service=ncv:ConfigPulls&graph_width=576&graph_height=120&disp=nsmdenvp185&nostale&color=blue&graph_start=1568489816&graph_end=1568662616&graph=hourly&action=view' ./showgraph.sh | sed '1,/^$/d' | file -
and see if it shows that a PNG file format was generated.
If this doesn't work, check for a service name such as "cpu" that is known to work, rather than your custom "ncv:ConfigPulls".
Content-type: text/html
<html><head><title>Invalid request</title></head> <body>Invalid request - no host or service</body></html>
Yep, cos no QUERY_STRING.
$ ls /var/lib/xymon/rrd/nsmdenvp185/ConfigPulls* /var/lib/xymon/rrd/nsmdenvp185/ConfigPulls.rrd root nsmdenvp117:/usr/lib64/xymon/cgi-bin $ cat ~ptroot/crap2 #!/bin/bash
$ curl -k https://nsmdenvp117.corp.intranet/xymon-cgi/showgraph.sh\?host=nsmdenvp185\&service=ncv:ConfigPulls\&graph_width=576\&graph_height=120\&disp=nsmdenvp185\&nostale\&color=blue\&graph_start=1568489816\&graph_end=1568662616\&graph=hourly\&action=view<https://imss91-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=https%3a%2f%2fnsmdenvp117.corp.intranet%2fxymon%2dcgi%2fshowgraph.sh%255C%3fhost%3dnsmdenvp185%255C%26service%3dncv%3aConfigPulls%255C%26graph%5fwidth%3d576%255C%26graph%5fheight%3d120%255C%26disp%3dnsmdenvp185%255C%26nostale%255C%26color%3dblue%255C%26graph%5fstart%3d1568489816%255C%26graph%5fend%3d1568662616%255C%26graph%3dhourly%255C%26action%3dview&umid=656D8EA6-92B1-9705-83D0-CC28939636BB&auth=19120be9529b25014b618505cb01789c5433dae7-c5515d751c27d0f5b49b12d1513ad03efa095723> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>500 Internal Server Error</title>
This works for me (substituting my own Xymon servername, hostname and service.
</head><body> <h1>Internal Server Error</h1>
This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
Following your commands, the only suggestion is that the variables might not have been set correctly. Perhaps run "echo $QUERY_STRING; echo $REQUEST_METHOD; echo $SCRIPT_NAME" immediately before "$SCRIPT_NAME".
In case my instructions were amiss, here's another example of debugging showgraph.sh to follow:
https://lists.xymon.com/archive/2012-July/035214.html
J
On Wed, 18 Sep 2019 at 04:32, Root, Paul T <Paul.Root at centurylink.com> wrote:
I must be doing something group here, neither worked:
$ SCRIPT_NAME=showgraph.sh REQUEST_METHOD=GET
root nsmdenvp117:/etc/xymon/analysis.d
$ QUERY_STRING='host=nsmdenvp185&service=ncv:ConfigPulls&graph_width=576&graph_height=120&disp=nsmdenvp185&nostale&color=blue&graph_start=1568489816&graph_end=1568662616&graph=hourly&action=view'
$ PATH=$PATH:/usr/lib64/xymon/cgi-bin
$ type showgraph.sh
showgraph.sh is /usr/lib64/xymon/cgi-bin/showgraph.sh
$ showgraph.sh
Content-type: text/html
<html><head><title>Invalid request</title></head>
<body>Invalid request - no host or service</body></html>
$ export QUERY_STRING
$ export SCRIPTNAME
$ $SCRIPTNAME
$ export SCRIPT_NAME
$ $SCRIPT_NAME
Content-type: text/html
<html><head><title>Invalid request</title></head>
<body>Invalid request - no host or service</body></html>
$ QUERY_STRING='host=nsmdenvp185&service=cpu&graph_width=576&graph_height=120&disp=nsmdenvp185&nostale&color=blue&graph_start=1568489816&graph_end=1568662616&graph=hourly&action=view'
$ $SCRIPT_NAME
Content-type: text/html
<html><head><title>Invalid request</title></head>
<body>Invalid request - no host or service</body></html>
$ file /usr/lib64/xymon/cgi-bin/showgraph.sh
/usr/lib64/xymon/cgi-bin/showgraph.sh: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
*From:* Jeremy Laidman <jeremy at laidman.org> *Sent:* Monday, September 16, 2019 3:38 PM *To:* Root, Paul T <Paul.Root at CenturyLink.com> *Cc:* xymon at xymon.com *Subject:* Re: [Xymon] Graphing in Xymon
On Tue, 17 Sep 2019 at 05:53, Root, Paul T <Paul.Root at centurylink.com> wrote:
Looping back on this:
Running the showgraph by hand
$ *./showgraph.sh host=nsmdenvp185 service=ncv:ConfigPulls graph_width=576 graph_height=120 disp=nsmdenvp185 nostale color=blue graph_start=1568489816 graph_end=1568662616 graph=hourly action=view*
This won't work. The showgraph.cgi binary expects to be run as a CGI and requires QUERY_STRING to be set (to host=nsmdenvp185&service=ncv:ConfigPulls&graph_width=...) and REQUEST_MATHOD to be set to "GET". It also expects SCRIPT_NAME to be set (and normally it would be showgraph.sh) but I think this only generates warnings.
Try running like so:
SCRIPT_NAME=showgraph.sh REQUEST_METHOD=GET QUERY_STRING='host=nsmdenvp185&service=ncv:ConfigPulls&graph_width=576&graph_height=120&disp=nsmdenvp185&nostale&color=blue&graph_start=1568489816&graph_end=1568662616&graph=hourly&action=view' ./showgraph.sh
The output will be partly binary, so you might want to try:
SCRIPT_NAME=showgraph.sh REQUEST_METHOD=GET QUERY_STRING='host=nsmdenvp185&service=ncv:ConfigPulls&graph_width=576&graph_height=120&disp=nsmdenvp185&nostale&color=blue&graph_start=1568489816&graph_end=1568662616&graph=hourly&action=view' ./showgraph.sh | sed '1,/^$/d' | file -
and see if it shows that a PNG file format was generated.
If this doesn't work, check for a service name such as "cpu" that is known to work, rather than your custom "ncv:ConfigPulls".
Content-type: text/html
<html><head><title>Invalid request</title></head>
<body>Invalid request - no host or service</body></html>
Yep, cos no QUERY_STRING.
$ *ls /var/lib/xymon/rrd/nsmdenvp185/ConfigPulls**
/var/lib/xymon/rrd/nsmdenvp185/ConfigPulls.rrd
root nsmdenvp117:/usr/lib64/xymon/cgi-bin
$ cat ~ptroot/crap2
#!/bin/bash
$* curl -k https://nsmdenvp117.corp.intranet/xymon-cgi/showgraph.sh\?host=nsmdenvp185\&service=ncv:ConfigPulls\&graph_width=576\&graph_height=120\&disp=nsmdenvp185\&nostale\&color=blue\&graph_start=1568489816\&graph_end=1568662616\&graph=hourly\&action=view <https://imss91-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=https%3a%2f%2fnsmdenvp117.corp.intranet%2fxymon%2dcgi%2fshowgraph.sh%255C%3fhost%3dnsmdenvp185%255C%26service%3dncv%3aConfigPulls%255C%26graph%5fwidth%3d576%255C%26graph%5fheight%3d120%255C%26disp%3dnsmdenvp185%255C%26nostale%255C%26color%3dblue%255C%26graph%5fstart%3d1568489816%255C%26graph%5fend%3d1568662616%255C%26graph%3dhourly%255C%26action%3dview&umid=656D8EA6-92B1-9705-83D0-CC28939636BB&auth=19120be9529b25014b618505cb01789c5433dae7-c5515d751c27d0f5b49b12d1513ad03efa095723>*
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
This works for me (substituting my own Xymon servername, hostname and service.
</head><body>
<h1>Internal Server Error</h1>
This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
Ah, that got it. I had REQUEST_METHOD=get on the same line as SCRIPT_NAME, effectively making the command ?showgraph REQUEST_METHOD=GET?
Also, the QUERY_STRING does not want the ncv: in it.
ConfigPulls yields: $ $SCRIPT_NAME Content-type: text/html
<html><head><title>Invalid request</title></head> <body>Unknown graph requested</body></html>
While cpu, and another custom graph we have (proc-mem) both work fine.
I?m thinking the upper case maybe causing the issue. I?m going to try to rename the test to lowercase.
From: Jeremy Laidman <jeremy at laidman.org> Sent: Wednesday, September 18, 2019 6:47 PM To: Root, Paul T <Paul.Root at CenturyLink.com> Cc: xymon at xymon.com Subject: Re: [Xymon] Graphing in Xymon
Following your commands, the only suggestion is that the variables might not have been set correctly. Perhaps run "echo $QUERY_STRING; echo $REQUEST_METHOD; echo $SCRIPT_NAME" immediately before "$SCRIPT_NAME".
In case my instructions were amiss, here's another example of debugging showgraph.sh to follow:
J
On Wed, 18 Sep 2019 at 04:32, Root, Paul T <Paul.Root at centurylink.com<mailto:Paul.Root at centurylink.com>> wrote: I must be doing something group here, neither worked:
$ SCRIPT_NAME=showgraph.sh REQUEST_METHOD=GET root nsmdenvp117:/etc/xymon/analysis.d $ QUERY_STRING='host=nsmdenvp185&service=ncv:ConfigPulls&graph_width=576&graph_height=120&disp=nsmdenvp185&nostale&color=blue&graph_start=1568489816&graph_end=1568662616&graph=hourly&action=view' $ PATH=$PATH:/usr/lib64/xymon/cgi-bin $ type showgraph.sh showgraph.sh is /usr/lib64/xymon/cgi-bin/showgraph.sh $ showgraph.sh Content-type: text/html
<html><head><title>Invalid request</title></head> <body>Invalid request - no host or service</body></html> $ export QUERY_STRING $ export SCRIPTNAME $ $SCRIPTNAME $ export SCRIPT_NAME $ $SCRIPT_NAME Content-type: text/html
<html><head><title>Invalid request</title></head> <body>Invalid request - no host or service</body></html> $ QUERY_STRING='host=nsmdenvp185&service=cpu&graph_width=576&graph_height=120&disp=nsmdenvp185&nostale&color=blue&graph_start=1568489816&graph_end=1568662616&graph=hourly&action=view' $ $SCRIPT_NAME Content-type: text/html
<html><head><title>Invalid request</title></head> <body>Invalid request - no host or service</body></html> $ file /usr/lib64/xymon/cgi-bin/showgraph.sh /usr/lib64/xymon/cgi-bin/showgraph.sh: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
From: Jeremy Laidman <jeremy at laidman.org<mailto:jeremy at laidman.org>> Sent: Monday, September 16, 2019 3:38 PM To: Root, Paul T <Paul.Root at CenturyLink.com<mailto:Paul.Root at CenturyLink.com>> Cc: xymon at xymon.com<mailto:xymon at xymon.com> Subject: Re: [Xymon] Graphing in Xymon
On Tue, 17 Sep 2019 at 05:53, Root, Paul T <Paul.Root at centurylink.com<mailto:Paul.Root at centurylink.com>> wrote: Looping back on this:
Running the showgraph by hand
$ ./showgraph.sh host=nsmdenvp185 service=ncv:ConfigPulls graph_width=576 graph_height=120 disp=nsmdenvp185 nostale color=blue graph_start=1568489816 graph_end=1568662616 graph=hourly action=view
This won't work. The showgraph.cgi binary expects to be run as a CGI and requires QUERY_STRING to be set (to host=nsmdenvp185&service=ncv:ConfigPulls&graph_width=...) and REQUEST_MATHOD to be set to "GET". It also expects SCRIPT_NAME to be set (and normally it would be showgraph.sh) but I think this only generates warnings.
Try running like so:
SCRIPT_NAME=showgraph.sh REQUEST_METHOD=GET QUERY_STRING='host=nsmdenvp185&service=ncv:ConfigPulls&graph_width=576&graph_height=120&disp=nsmdenvp185&nostale&color=blue&graph_start=1568489816&graph_end=1568662616&graph=hourly&action=view' ./showgraph.sh
The output will be partly binary, so you might want to try:
SCRIPT_NAME=showgraph.sh REQUEST_METHOD=GET QUERY_STRING='host=nsmdenvp185&service=ncv:ConfigPulls&graph_width=576&graph_height=120&disp=nsmdenvp185&nostale&color=blue&graph_start=1568489816&graph_end=1568662616&graph=hourly&action=view' ./showgraph.sh | sed '1,/^$/d' | file -
and see if it shows that a PNG file format was generated.
If this doesn't work, check for a service name such as "cpu" that is known to work, rather than your custom "ncv:ConfigPulls".
Content-type: text/html
<html><head><title>Invalid request</title></head> <body>Invalid request - no host or service</body></html>
Yep, cos no QUERY_STRING.
$ ls /var/lib/xymon/rrd/nsmdenvp185/ConfigPulls* /var/lib/xymon/rrd/nsmdenvp185/ConfigPulls.rrd root nsmdenvp117:/usr/lib64/xymon/cgi-bin $ cat ~ptroot/crap2 #!/bin/bash
$ curl -k https://nsmdenvp117.corp.intranet/xymon-cgi/showgraph.sh\?host=nsmdenvp185\&service=ncv:ConfigPulls\&graph_width=576\&graph_height=120\&disp=nsmdenvp185\&nostale\&color=blue\&graph_start=1568489816\&graph_end=1568662616\&graph=hourly\&action=view<https://imss91-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=https%3a%2f%2fnsmdenvp117.corp.intranet%2fxymon%2dcgi%2fshowgraph.sh%255C%3fhost%3dnsmdenvp185%255C%26service%3dncv%3aConfigPulls%255C%26graph%5fwidth%3d576%255C%26graph%5fheight%3d120%255C%26disp%3dnsmdenvp185%255C%26nostale%255C%26color%3dblue%255C%26graph%5fstart%3d1568489816%255C%26graph%5fend%3d1568662616%255C%26graph%3dhourly%255C%26action%3dview&umid=53F7D197-92DC-7705-AA3B-96B005793723&auth=19120be9529b25014b618505cb01789c5433dae7-99d13073304ea227297a4aef5b6bce69d989c333> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>500 Internal Server Error</title>
This works for me (substituting my own Xymon servername, hostname and service.
</head><body> <h1>Internal Server Error</h1>
This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
It's my understanding that the "service=XYZ" option is used to find a match in graphs.cfg (ie [XYZ]). Usually this is the same string as the column name, but sometimes not, and I have to admit that I don't fully understand the relationships between RRD filename, graph name, column name, service name, the variables TEST2RRD and GRAPHS and the per-host TRENDS settings.
On Fri, 20 Sep 2019 at 03:03, Root, Paul T <Paul.Root at centurylink.com> wrote:
Ah, that got it. I had REQUEST_METHOD=get on the same line as SCRIPT_NAME, effectively making the command ?showgraph REQUEST_METHOD=GET?
Also, the QUERY_STRING does not want the ncv: in it.
ConfigPulls yields:
$ $SCRIPT_NAME
Content-type: text/html
<html><head><title>Invalid request</title></head>
<body>Unknown graph requested</body></html>
While cpu, and another custom graph we have (proc-mem) both work fine.
I?m thinking the upper case maybe causing the issue. I?m going to try to rename the test to lowercase.
*From:* Jeremy Laidman <jeremy at laidman.org> *Sent:* Wednesday, September 18, 2019 6:47 PM *To:* Root, Paul T <Paul.Root at CenturyLink.com> *Cc:* xymon at xymon.com *Subject:* Re: [Xymon] Graphing in Xymon
Following your commands, the only suggestion is that the variables might not have been set correctly. Perhaps run "echo $QUERY_STRING; echo $REQUEST_METHOD; echo $SCRIPT_NAME" immediately before "$SCRIPT_NAME".
In case my instructions were amiss, here's another example of debugging showgraph.sh to follow:
https://lists.xymon.com/archive/2012-July/035214.html <https://imss91-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=https%3a%2f%2flists.xymon.com%2farchive%2f2012%2dJuly%2f035214.html&umid=53F7D197-92DC-7705-AA3B-96B005793723&auth=19120be9529b25014b618505cb01789c5433dae7-0da69dac38e7cd9a0ec0cb613ccf621beba4f183>
J
On Wed, 18 Sep 2019 at 04:32, Root, Paul T <Paul.Root at centurylink.com> wrote:
I must be doing something group here, neither worked:
$ SCRIPT_NAME=showgraph.sh REQUEST_METHOD=GET
root nsmdenvp117:/etc/xymon/analysis.d
$ QUERY_STRING='host=nsmdenvp185&service=ncv:ConfigPulls&graph_width=576&graph_height=120&disp=nsmdenvp185&nostale&color=blue&graph_start=1568489816&graph_end=1568662616&graph=hourly&action=view'
$ PATH=$PATH:/usr/lib64/xymon/cgi-bin
$ type showgraph.sh
showgraph.sh is /usr/lib64/xymon/cgi-bin/showgraph.sh
$ showgraph.sh
Content-type: text/html
<html><head><title>Invalid request</title></head>
<body>Invalid request - no host or service</body></html>
$ export QUERY_STRING
$ export SCRIPTNAME
$ $SCRIPTNAME
$ export SCRIPT_NAME
$ $SCRIPT_NAME
Content-type: text/html
<html><head><title>Invalid request</title></head>
<body>Invalid request - no host or service</body></html>
$ QUERY_STRING='host=nsmdenvp185&service=cpu&graph_width=576&graph_height=120&disp=nsmdenvp185&nostale&color=blue&graph_start=1568489816&graph_end=1568662616&graph=hourly&action=view'
$ $SCRIPT_NAME
Content-type: text/html
<html><head><title>Invalid request</title></head>
<body>Invalid request - no host or service</body></html>
$ file /usr/lib64/xymon/cgi-bin/showgraph.sh
/usr/lib64/xymon/cgi-bin/showgraph.sh: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
*From:* Jeremy Laidman <jeremy at laidman.org> *Sent:* Monday, September 16, 2019 3:38 PM *To:* Root, Paul T <Paul.Root at CenturyLink.com> *Cc:* xymon at xymon.com *Subject:* Re: [Xymon] Graphing in Xymon
On Tue, 17 Sep 2019 at 05:53, Root, Paul T <Paul.Root at centurylink.com> wrote:
Looping back on this:
Running the showgraph by hand
$ *./showgraph.sh host=nsmdenvp185 service=ncv:ConfigPulls graph_width=576 graph_height=120 disp=nsmdenvp185 nostale color=blue graph_start=1568489816 graph_end=1568662616 graph=hourly action=view*
This won't work. The showgraph.cgi binary expects to be run as a CGI and requires QUERY_STRING to be set (to host=nsmdenvp185&service=ncv:ConfigPulls&graph_width=...) and REQUEST_MATHOD to be set to "GET". It also expects SCRIPT_NAME to be set (and normally it would be showgraph.sh) but I think this only generates warnings.
Try running like so:
SCRIPT_NAME=showgraph.sh REQUEST_METHOD=GET QUERY_STRING='host=nsmdenvp185&service=ncv:ConfigPulls&graph_width=576&graph_height=120&disp=nsmdenvp185&nostale&color=blue&graph_start=1568489816&graph_end=1568662616&graph=hourly&action=view' ./showgraph.sh
The output will be partly binary, so you might want to try:
SCRIPT_NAME=showgraph.sh REQUEST_METHOD=GET QUERY_STRING='host=nsmdenvp185&service=ncv:ConfigPulls&graph_width=576&graph_height=120&disp=nsmdenvp185&nostale&color=blue&graph_start=1568489816&graph_end=1568662616&graph=hourly&action=view' ./showgraph.sh | sed '1,/^$/d' | file -
and see if it shows that a PNG file format was generated.
If this doesn't work, check for a service name such as "cpu" that is known to work, rather than your custom "ncv:ConfigPulls".
Content-type: text/html
<html><head><title>Invalid request</title></head>
<body>Invalid request - no host or service</body></html>
Yep, cos no QUERY_STRING.
$ *ls /var/lib/xymon/rrd/nsmdenvp185/ConfigPulls**
/var/lib/xymon/rrd/nsmdenvp185/ConfigPulls.rrd
root nsmdenvp117:/usr/lib64/xymon/cgi-bin
$ cat ~ptroot/crap2
#!/bin/bash
$* curl -k https://nsmdenvp117.corp.intranet/xymon-cgi/showgraph.sh\?host=nsmdenvp185\&service=ncv:ConfigPulls\&graph_width=576\&graph_height=120\&disp=nsmdenvp185\&nostale\&color=blue\&graph_start=1568489816\&graph_end=1568662616\&graph=hourly\&action=view <https://imss91-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=https%3a%2f%2fnsmdenvp117.corp.intranet%2fxymon%2dcgi%2fshowgraph.sh%255C%3fhost%3dnsmdenvp185%255C%26service%3dncv%3aConfigPulls%255C%26graph%5fwidth%3d576%255C%26graph%5fheight%3d120%255C%26disp%3dnsmdenvp185%255C%26nostale%255C%26color%3dblue%255C%26graph%5fstart%3d1568489816%255C%26graph%5fend%3d1568662616%255C%26graph%3dhourly%255C%26action%3dview&umid=53F7D197-92DC-7705-AA3B-96B005793723&auth=19120be9529b25014b618505cb01789c5433dae7-99d13073304ea227297a4aef5b6bce69d989c333>*
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
This works for me (substituting my own Xymon servername, hostname and service.
</head><body>
<h1>Internal Server Error</h1>
This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
participants (2)
-
jeremy@laidman.org
-
Paul.Root@CenturyLink.com