Xymon Mailing List Archive search

SOAP test

3 messages in this thread

list Mario Andre · Tue, 24 Jul 2012 11:22:54 -0300 ·
Hello all,

I need to monitor some soap URLs and I´m not getting success on it.
Does someone know how to create the request xml file for the SOAP test in
xymon?
Is there someone here who has a sample soap test to share?


Thanks in advance,
Mario Andre.
list Benjamin Boudoir · Tue, 24 Jul 2012 17:20:20 +0200 ·
quoted from Mario Andre
Le mardi 24 juillet 2012 16:22:54, Mario Andre Panza a écrit :
Hello all,

I need to monitor some soap URLs and I´m not getting success on it.
Does someone know how to create the request xml file for the SOAP test in
xymon?
Is there someone here who has a sample soap test to share?


Thanks in advance,
Mario Andre.
Hello,

You can do it by some way :
The http test may be sufficent  (just add a http://domain.tld/mysoap.xml in you're bb-hosts file).

But if you wanted to test the methods, you can make a script that check a know value of one of theses methods (hint : try to check the last method, you'll know if the xml file is fully loaded) and return an alert if it's not true.

In bash, this will make something like :

#!/bin/bash

COLUMN=soaptest

function soap_test {
   [execute a soap method here]
}

knowvalue=whatever
mytest="$(soap_test)"

if [ "$mytest" = "$knownvalue" ]
then
	MSG="Seems good"
	COLOR="green"
else
	MSG="I've got $mytest but $knownvalue is expected. Is there a problem?"
	COLOR="red"
fi

$BB $BBDISP "status $MACHINE.$COLUMN $COLOR `date`                                                                                                                                                                                                                                                                                                                                                                                                                                                    ${MSG}                                                                                                                                                                                                                                             "

For my own, I don't have this sort of soap test script* and I don't think bash would be a good choice (never heard of a cli tool for SOAP) but something like this will work.

* but a python script launched once a day by a cron (because of a limits on this API) that export data in a file checked by a bash script that check and format output for Xymon.

-- 
Benjamin Boudoir
Melty Network / Eeple
Administrateur Système
list Henrik Størner · Thu, 26 Jul 2012 16:46:49 +0200 ·
quoted from Mario Andre
On 24-07-2012 16:22, Mario Andre Panza wrote:
I need to monitor some soap URLs and I´m not getting success on it.
Does someone know how to create the request xml file for the SOAP test
in xymon?
It depends on the application you're monitoring. The content of the XML document is specific to the application, since it is the application that will interpret the XML. So talk to your apps-team, or the vendor who sold you the application.

Worst case, do a network trace of the traffic to the application.

Is there someone here who has a sample soap test to share?
Here's one I use, BUT: The XML is application specific, so you cannot just use this and expect it to work:

The XML document, stored in /etc/xymon/soap/crud-echo.xml :

<?xml version="1.0"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:crud="http://myapp.myorg.example.com">;
    <soapenv:Header/>
    <soapenv:Body>
       <crud:echo>
          <txt>Web Service up and running</txt>
       </crud:echo>
    </soapenv:Body>
</soapenv:Envelope>

The hosts.cfg entry (all on one line):

10.0.0.1 myserver.example.com  # soap=echo;http://myserver.example.com:/myapp/services/Search?wsdl;file:/etc/xymon/soap/crud-echo.xml;Web.Service.up.and.running


Regards,
Henrik