Sending to NRPE without using send_nrdp script

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Sending to NRPE without using send_nrdp script

Post by BanditBBS »

I have a very weird use case here where it'd make my life extremely easier if I could send passive check results to NagiosXI using nrdp by without using the send_nrdp.pl script.

Currently in the script this line is sending the results to XI:

Code: Select all

rslt=`curl -f --silent --insecure -d "$pdata" "$url/"`
I know what the $pdata variable contains(some xml) and of course the $url. Is there any way I can turn this into just a custom URL that I could put into chrome, edge, firefox, whatever browser that would send the results to XI?
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Sending to NRPE without using send_nrdp script

Post by vtrac »

Hi,
I looked at the "send_nrdp.sh" from Nagios Exchange and test the URL calls on Chrome.

I test it with this XML:

Code: Select all

<?xml version='1.0'?>
<checkresults>
    <checkresult type='host'>
        <hostname>192.168.23.63-ncpa</hostname>
        <state>0</state>
        <output>Everything looks okay! | perfdata=1;</output>
    </checkresult>
</checkresults>
Converted the XML to url-enended (ONE line):

Code: Select all

%3C%3Fxml%20version%3D'1.0'%3F%3E%0A%3Ccheckresults%3E%0A%3Ccheckresult%20type%3D'host'%3E%0A%3Chostname%3E192.168.23.63-ncpa%3C%2Fhostname%3E%0A%3Cstate%3E0%3C%2Fstate%3E%0A%3Coutput%3EEverything%20looks%20okay!%20%7C%20perfdata%3D1%3B%3C%2Foutput%3E%0A%3C%2Fcheckresult%3E%0A%3C%2Fcheckresults%3E
I tested it by pasting the URL (below) onto chrome:

Code: Select all

http://192.168.23.61/nrdp/?token=VT9900&cmd=submitcheck&xml=%3C%3Fxml%20version%3D'1.0'%3F%3E%0A%3Ccheckresults%3E%0A%3Ccheckresult%20type%3D'host'%3E%0A%3Chostname%3E192.168.23.63-ncpa%3C%2Fhostname%3E%0A%3Cstate%3E0%3C%2Fstate%3E%0A%3Coutput%3EEverything%20looks%20okay!%20%7C%20perfdata%3D1%3B%3C%2Foutput%3E%0A%3C%2Fcheckresult%3E%0A%3C%2Fcheckresults%3E
w1.png
My Nagios XI host updated:
w2.png

Regards,
Vinh
You do not have the required permissions to view the files attached to this post.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Sending to NRPE without using send_nrdp script

Post by BanditBBS »

You just made me scream in joy on a call with my boss as I read your reply.

Feel free to close this one up, thanks!
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Sending to NRPE without using send_nrdp script

Post by vtrac »

Great!! .... locking post/ticket ... :-)
Locked