nagios:~ # su - nagios
nagios@nagios:~> bash -x /usr/local/nagios/libexec/send_nrdp.sh -u
https://10.5.8.x/nrdp/ -t XXXX -H "sqlsrv01" -s "Memory Usage" -S 0 -o "Memory usage: total:98302.09 Mb - used: 54664.65 Mb (56%) - free: 43637.44 Mb (44%)"
++ basename /usr/local/nagios/libexec/send_nrdp.sh
+ PROGNAME=send_nrdp.sh
+ RELEASE='Revision 0.5'
+ getopts u:t:H:s:S

f:d:c:D:hv option
+ case $option in
+ url=
https://10.5.8.x/nrdp/
+ getopts u:t:H:s:S

f:d:c:D:hv option
+ case $option in
+ token=XXXX
+ getopts u:t:H:s:S

f:d:c:D:hv option
+ case $option in
+ host=sqlsrv01
+ getopts u:t:H:s:S

f:d:c:D:hv option
+ case $option in
+ service='Memory Usage'
+ getopts u:t:H:s:S

f:d:c:D:hv option
+ case $option in
+ State=0
+ getopts u:t:H:s:S

f:d:c:D:hv option
+ case $option in
+ output='Memory usage: total:98302.09 Mb - used: 54664.65 Mb (56%) - free: 43637.44 Mb (44%)'
+ getopts u:t:H:s:S

f:d:c:D:hv option
+ '[' '!' ']'
+ checktype=1
+ '[' '!' ']'
++ echo -e '\t'
+ delim=' '
+ '[' xhttps://10.5.8.x/nrdp/ == x -o XXXX == x ']'
++ which curl
+ [[ /usr/bin/curl =~ /curl ]]
+ curl=1
++ which wget
+ [[ /usr/bin/wget =~ /wget ]]
+ wget=1
+ [[ ! -n 1 ]]
+ checkcount=0
+ '[' sqlsrv01 ']'
+ xml=
+ '[' sqlsrv01 == '' ']'
+ '[' 0 == '' ']'
+ '[' 'Memory Usage' '!=' '' ']'
+ xml='<checkresult type='\''service'\'' checktype='\''1'\''><servicename>Memory Usage</servicename>'
+ output='Memory usage: total:98302.09 Mb - used: 54664.65 Mb (56%) - free: 43637.44 Mb (44%)'
+ output='Memory usage: total:98302.09 Mb - used: 54664.65 Mb (56%) - free: 43637.44 Mb (44%)'
+ output='Memory usage: total:98302.09 Mb - used: 54664.65 Mb (56%) - free: 43637.44 Mb (44%)'
+ xml='<checkresult type='\''service'\'' checktype='\''1'\''><servicename>Memory Usage</servicename><hostname>sqlsrv01</hostname><state>0</state><output><![CDATA[Memory usage: total:98302.09 Mb - used: 54664.65 Mb (56%) - free: 43637.44 Mb (44%)]]></output></checkresult>'
+ checkcount=1
+ '[' '!' -t 0 ']'
+ '[' ']'
+ '[' ']'
+ '[' x == x ']'
+ '[' x == x ']'
+ xml='<?xml version='\''1.0'\''?><checkresults><checkresult type='\''service'\'' checktype='\''1'\''><servicename>Memory Usage</servicename><hostname>sqlsrv01</hostname><state>0</state><output><![CDATA[Memory usage: total:98302.09 Mb - used: 54664.65 Mb (56%) - free: 43637.44 Mb (44%)]]></output></checkresult></checkresults>'
+ send_data '<?xml version='\''1.0'\''?><checkresults><checkresult type='\''service'\'' checktype='\''1'\''><servicename>Memory Usage</servicename><hostname>sqlsrv01</hostname><state>0</state><output><![CDATA[Memory usage: total:98302.09 Mb - used: 54664.65 Mb (56%) - free: 43637.44 Mb (44%)]]></output></checkresult></checkresults>'
+ pdata='token=XXXX&cmd=submitcheck'
+ '[' '!' x1 == x ']'
+ '[' ']'
+ pdata='token=XXXX&cmd=submitcheck&XMLDATA=<?xml version='\''1.0'\''?><checkresults><checkresult type='\''service'\'' checktype='\''1'\''><servicename>Memory Usage</servicename><hostname>sqlsrv01</hostname><state>0</state><output><![CDATA[Memory usage: total:98302.09 Mb - used: 54664.65 Mb (56%) - free: 43637.44 Mb (44%)]]></output></checkresult></checkresults>'
++ curl -f --silent --insecure -d 'token=XXXX&cmd=submitcheck&XMLDATA=<?xml version='\''1.0'\''?><checkresults><checkresult type='\''service'\'' checktype='\''1'\''><servicename>Memory Usage</servicename><hostname>sqlsrv01</hostname><state>0</state><output><![CDATA[Memory usage: total:98302.09 Mb - used: 54664.65 Mb (56%) - free: 43637.44 Mb (44%)]]></output></checkresult></checkresults>'
https://10.5.8.x/nrdp//
+ rslt='<?xml version="1.0" encoding="utf-8"?>
<result>
<status>0</status>
<message>OK</message>
<meta>
<output>1 checks processed</output>
</meta>
</result>'
+ ret=0
++ sed -n 's|.*<status>\(.*\)</status>.*|\1|p'
++ echo '<?xml' 'version="1.0"' 'encoding="utf-8"?>' '<result>' '<status>0</status>' '<message>OK</message>' '<meta>' '<output>1' checks 'processed</output>' '</meta>' '</result>'
+ status=0
++ sed -n 's|.*<message>\(.*\)</message>.*|\1|p'
++ echo '<?xml' 'version="1.0"' 'encoding="utf-8"?>' '<result>' '<status>0</status>' '<message>OK</message>' '<meta>' '<output>1' checks 'processed</output>' '</meta>' '</result>'
+ message=OK
+ '[' 0 '!=' 0 ']'
+ '[' 0 '!=' 0 ']'
+ '[' ']'
+ '[' 0 '!=' 0 ']'
+ echo 'Sent 1 checks to
https://10.5.8.x/nrdp/'
Sent 1 checks to
https://10.5.8.x/nrdp/
nagios@nagios:~>
And to make it weird, that check went to the XI server as unconfigured object.