SOAP Script monitoring

This forum is intended for the discussion of Nagios plugin development. Feature requests, patches, bug fixes, and all types of development-related discussions are welcome!

NOTE: The SourceForge.net nagiosplug-devel mailing list has been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

SOAP Script monitoring

Postby Srinija544 » Tue Jun 25, 2019 1:25 am

Hi All,

We are using Nagios Core and we have a new request to monitor SOAP Script. Please find the below script:

--soap '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sal="http://www.sonatacentral.com/service/v30/common/saleschannel" xmlns:ser="http://www.sonatacentral.com/service/v30/Service" xmlns:cal="http://www.sonatacentral.com/service/v30/CallerDetails" xmlns:iden="http://www.sonatacentral.com/service/v30/globaltypes/IdentifierType" xmlns:dat="http://www.sonatacentral.com/service/v30/globaltypes/common/data/DataGroupType"><soapenv:Header/><soapenv:Body><sal:getLocationRequest><ser:CallerDetails><cal:username>demo</cal:username><cal:country>AU</cal:country><cal:language>en</cal:language><cal:databaseIdentifier>SONUAT</cal:databaseIdentifier></ser:CallerDetails><sal:LocationIdentifier><iden:id>40000001</iden:id></sal:LocationIdentifier></sal:getLocationRequest></soapenv:Body></soapenv:Envelope>'

===============================================

We have placed this script in Nagios server using this command:

check_command check_soap!--action "GetResponse" --url "http://dc1uat163.twruat.ext/sonata/services/v30/salesChannelService" --grep '(?<=40000001>)[0-9]+(?=</)' --soap '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sal="http://www.sonatacentral.com/service/v30/common/saleschannel" xmlns:ser="http://www.sonatacentral.com/service/v30/Service" xmlns:cal="http://www.sonatacentral.com/service/v30/CallerDetails" xmlns:iden="http://www.sonatacentral.com/service/v30/globaltypes/IdentifierType" xmlns:dat="http://www.sonatacentral.com/service/v30/globaltypes/common/data/DataGroupType"><soapenv:Header/><soapenv:Body><sal:getLocationRequest><ser:CallerDetails><cal:username>demo</cal:username><cal:country>AU</cal:country><cal:language>en</cal:language><cal:databaseIdentifier>SONUAT</cal:databaseIdentifier></ser:CallerDetails><sal:LocationIdentifier><iden:id>40000001</iden:id></sal:LocationIdentifier></sal:getLocationRequest></soapenv:Body></soapenv:Envelope>'

=============================================

However we are getting an error message as below:

SOAP UNKNOWN: Failed to extract value from response

==================================================

Please someone help me on this request.

Regards,
Srinija.
Srinija544
 
Posts: 27
Joined: Mon Oct 15, 2018 9:30 pm

Re: SOAP Script monitoring

Postby cdienger » Tue Jun 25, 2019 2:49 pm

I'm not familiar with that plugin. Can you provide a link to download it or attach it to the ticket? Are you able to run it directly from the command line?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
cdienger
Support Tech
 
Posts: 3791
Joined: Tue Feb 07, 2017 11:26 am

Re: SOAP Script monitoring

Postby Srinija544 » Wed Jun 26, 2019 4:40 am

Hi cdienger,

Thank you for your response.

Please find the attached script of check_soap plugin which we are using for our alert. We are using this script in our Nagios server.

We have command to this in our commands.cfg file:

define command{
command_name check_soap
command_line $USER1$/monitoring-plugins/check_soap.sh $ARG1$
}

Could you please check and help me on this?
Attachments
check_soap.txt
(3.65 KiB) Downloaded 68 times
Srinija544
 
Posts: 27
Joined: Mon Oct 15, 2018 9:30 pm

Re: SOAP Script monitoring

Postby cdienger » Thu Jun 27, 2019 2:45 pm

Run the command like this to get debug output:

Code: Select all
bash -x /usr/local/nagios/libexec/check_soap.sh --action "GetResponse" --url "http://www.gosomethingsomething.com" --grep '(?<=40000001>)[0-9]+(?=</)' --soap '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sal="http://www.sonatacentral.com/service/v30/common/saleschannel" xmlns:ser="http://www.sonatacentral.com/service/v30/Service" xmlns:cal="http://www.sonatacentral.com/service/v30/CallerDetails" xmlns:iden="http://www.sonatacentral.com/service/v30/globaltypes/IdentifierType" xmlns:dat="http://www.sonatacentral.com/service/v30/globaltypes/common/data/DataGroupType"><soapenv:Header/><soapenv:Body><sal:getLocationRequest><ser:CallerDetails><cal:username>demo</cal:username><cal:country>AU</cal:country><cal:language>en</cal:language><cal:databaseIdentifier>SONUAT</cal:databaseIdentifier></ser:CallerDetails><sal:LocationIdentifier><iden:id>40000001</iden:id></sal:LocationIdentifier></sal:getLocationRequest></soapenv:Body></soapenv:Envelope>'
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
cdienger
Support Tech
 
Posts: 3791
Joined: Tue Feb 07, 2017 11:26 am


Return to Nagios Plugin Development

Who is online

Users browsing this forum: No registered users and 4 guests