send_nrdp.sh sending values for multiple measurements
Posted: Sun May 31, 2020 8:33 am
Hello all,
I'm trying to figure out how to get perfdata and charts for routes on a network that include the host, the route name, number of circuits, number of occupied circuits, number of blocked circuits, the number of available circuits (number of circuits - number occupied - number of blocked), and the state of the route. I've scripted it all and have been trying different examples of scripts that I've found online. And now I'm stuck and my brain hurts.
Here's my send_nrdp.sh command that I've pulled out of various sources.
Let me start with the Nagios KB article located here:
https://support.nagios.com/kb/article/n ... t-599.html
It seems to be too simple of an explanation. I've removed blank lines:
./send_nrdp.sh -h
send_nrdp.sh Revision 0.6.1 - Send NRDP script for Nagios
Usage: send_nrdp.sh -u URL -t token [options]
Usage: send_nrdp.sh -h display help
This script is used to send NRDP data to a Nagios server
Required:
-u, URL of NRDP server. Usually http://<IP_ADDRESS>/nrdp/
-t, Shared token. Must be the same token set in NRDP Server
Options:
Single Check:
-H host name
-s service name
-S State -
-o output
However, I've found an example that lead me to build this. I had it working once, but I was working very late last night and got brain freeze.
I think I've made it more complicated than I should. At the point I had it working, I was able to see perfdata along with averages over a period of time.
I have the data, I just need to know the command line to send it. Please help!
$NRDP_CLIENT -u http://168.125.36.9/nrdp/ -t "$TOKEN" -H "$t_TESname" -s "$t_route" -S "0" -o "NDV=${t_NDV}, NOCC=${t_NOCC}, NIDL=${t_NIDL}, NBLO=${t_NBLO}, RSTAT=${t_RSTAT}, AVAIL=${t_AVAIL} | NDV=${t_NDV};;;; NOCC=${t_NOCC};;;;NIDL=${t_NIDL};;;; NBLO=${t_NBLO};;;; RSTAT=${t_RSTAT};;;; AVAIL=${t_AVAIL};;;;"
QUESTIONS:
What is the significance of the | in the middle of the command?
How long should it take for the data sent to appear on the service page?
What are the semi-colons for? (I suspect this asks Nagios to provide averages?)
What is the pipe | character for? (I suspcet this separates the output versus the perfdata?
Where can I find where the server receives the NRDP info? (I suspect this is in the /var/nagiosramdisk files)
Any help would be appreciated.
I'm trying to figure out how to get perfdata and charts for routes on a network that include the host, the route name, number of circuits, number of occupied circuits, number of blocked circuits, the number of available circuits (number of circuits - number occupied - number of blocked), and the state of the route. I've scripted it all and have been trying different examples of scripts that I've found online. And now I'm stuck and my brain hurts.
Here's my send_nrdp.sh command that I've pulled out of various sources.
Let me start with the Nagios KB article located here:
https://support.nagios.com/kb/article/n ... t-599.html
It seems to be too simple of an explanation. I've removed blank lines:
./send_nrdp.sh -h
send_nrdp.sh Revision 0.6.1 - Send NRDP script for Nagios
Usage: send_nrdp.sh -u URL -t token [options]
Usage: send_nrdp.sh -h display help
This script is used to send NRDP data to a Nagios server
Required:
-u, URL of NRDP server. Usually http://<IP_ADDRESS>/nrdp/
-t, Shared token. Must be the same token set in NRDP Server
Options:
Single Check:
-H host name
-s service name
-S State -
-o output
However, I've found an example that lead me to build this. I had it working once, but I was working very late last night and got brain freeze.
I think I've made it more complicated than I should. At the point I had it working, I was able to see perfdata along with averages over a period of time.
I have the data, I just need to know the command line to send it. Please help!
$NRDP_CLIENT -u http://168.125.36.9/nrdp/ -t "$TOKEN" -H "$t_TESname" -s "$t_route" -S "0" -o "NDV=${t_NDV}, NOCC=${t_NOCC}, NIDL=${t_NIDL}, NBLO=${t_NBLO}, RSTAT=${t_RSTAT}, AVAIL=${t_AVAIL} | NDV=${t_NDV};;;; NOCC=${t_NOCC};;;;NIDL=${t_NIDL};;;; NBLO=${t_NBLO};;;; RSTAT=${t_RSTAT};;;; AVAIL=${t_AVAIL};;;;"
QUESTIONS:
What is the significance of the | in the middle of the command?
How long should it take for the data sent to appear on the service page?
What are the semi-colons for? (I suspect this asks Nagios to provide averages?)
What is the pipe | character for? (I suspcet this separates the output versus the perfdata?
Where can I find where the server receives the NRDP info? (I suspect this is in the /var/nagiosramdisk files)
Any help would be appreciated.