You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there is whitespace in "<NAGIOS_DISP_HOSTNAME>" variable in pnp4nagios serivce xml file, I get XML file not found when posting to the labels endpoint.
API endpoints for host and service works.
If the "<NAGIOS_DISP_HOSTNAME>" variable is changed so it fits the "<NAGIOS_HOSTNAME>" variable in the pnp4nagios service XML file it works and I can get a fine graph in Grafana.
Hope it makes sense.
I am not sure that this issue is related to the API controller it self. I don't know PHP but it seems to be the most logical place to start looking for any bugs?
Also, I know whitspace can be a pain, but since it is supported in the Nagios Core I guess it should also be working in pnp4nagios api interface. I can also add that viewing graphs in pnp4nagios works fine with whitespace's in hostnames.
OK example with curl:
LiveU_diskplads.xml:
<NAGIOS_DISP_HOSTNAME>AP3100_LiveU1</NAGIOS_DISP_HOSTNAME>
Hi
If there is whitespace in "<NAGIOS_DISP_HOSTNAME>" variable in pnp4nagios serivce xml file, I get XML file not found when posting to the labels endpoint.
API endpoints for host and service works.
If the "<NAGIOS_DISP_HOSTNAME>" variable is changed so it fits the "<NAGIOS_HOSTNAME>" variable in the pnp4nagios service XML file it works and I can get a fine graph in Grafana.
Hope it makes sense.
I am not sure that this issue is related to the API controller it self. I don't know PHP but it seems to be the most logical place to start looking for any bugs?
Also, I know whitspace can be a pain, but since it is supported in the Nagios Core I guess it should also be working in pnp4nagios api interface. I can also add that viewing graphs in pnp4nagios works fine with whitespace's in hostnames.
OK example with curl:
LiveU_diskplads.xml:
<NAGIOS_DISP_HOSTNAME>AP3100_LiveU1</NAGIOS_DISP_HOSTNAME>
curl -s -H "Content-Type: application/json" -X POST -d '
{
"host":"AP3100_LiveU1",
"service":"LiveU_diskplads"
}' http://127.0.0.1/pnp4nagios/index.php/api/labels
{"labels":[{"name":"Liveu","label":"disk","service":"LiveU_diskplads","hostname":"AP3100_LiveU1"}]}
BAD example with curl:
LiveU_diskplads.xml:
Fail when <NAGIOS_DISP_HOSTNAME>AP3100 LiveU1</NAGIOS_DISP_HOSTNAME>
curl -s -H "Content-Type: application/json" -X POST -d '
{
"host":"AP3100_LiveU1",
"service":"LiveU_diskplads"
}' http://127.0.0.1/pnp4nagios/index.php/api/labels
{"error":
"XML file "/usr/local/pnp4nagios/var/perfdata/AP3100 LiveU1/LiveU_diskplads.xml" not found.
<a href="http://docs.pnp4nagios.org/faq/6">Read FAQ online</a>"}
The text was updated successfully, but these errors were encountered: