Prometheus For monitoring SOAP Endpoint.

2,160 views
Skip to first unread message

sivap...@evergent.com

unread,
Jul 25, 2017, 3:45:31 PM7/25/17
to Prometheus Users
Could you please help me with enabling of prometheus to collect metrics   Or to use prometheus for monitoring of my SOAP endpoint url.

The check should send some post data to the endpoint & validate service uptime by matching the response with regular expression.

Soap URL - https://10.0.5.206:5055/Services?wsdl



-T text/xml -P '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="services.website.com"> <soapenv:Header/> <soapenv:Body> <ser:apiname> <arg0> <channel>grow</channel> <password></password> <userName>admin</userName> <action>VIEW</action> <urn>urn:show:fp</urn> <userToken>LZgnlF</userToken> </arg0>  </ser:apiname> </soapenv:Body> </soapenv:Envelope>

Brian Brazil

unread,
Jul 26, 2017, 2:50:21 AM7/26/17
to sivap...@evergent.com, Prometheus Users
On 25 July 2017 at 20:45, <sivap...@evergent.com> wrote:
Could you please help me with enabling of prometheus to collect metrics   Or to use prometheus for monitoring of my SOAP endpoint url.

The check should send some post data to the endpoint & validate service uptime by matching the response with regular expression.


Look at https://github.com/prometheus/blackbox_exporter, in particular the http module's body and fail_if_not_matches_regexp parameters.

Brian
 
Soap URL - https://10.0.5.206:5055/Services?wsdl



-T text/xml -P '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="services.website.com"> <soapenv:Header/> <soapenv:Body> <ser:apiname> <arg0> <channel>grow</channel> <password></password> <userName>admin</userName> <action>VIEW</action> <urn>urn:show:fp</urn> <userToken>LZgnlF</userToken> </arg0>  </ser:apiname> </soapenv:Body> </soapenv:Envelope>

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/b4985bae-6dcb-4ecd-9f2b-7eb7d09f199c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

andreean...@gmail.com

unread,
May 2, 2018, 11:04:30 AM5/2/18
to Prometheus Users
Good day Brian,
Just like Siva, I am using blackbox exporter to monitor a soap endpoint. I was successful in simply getting a 200 back from the soap endpoint, but when we want to call a SOAP method, that's when things don't quite work. If I put the SOAP request envelop in the "body", something like the following:

      body: '
            <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
               <soapenv:Header/>
               <soapenv:Body>
                  <tem:Ping/>
               </soapenv:Body>
            </soapenv:Envelope>
            '

with a GET, although the soap response is:
   <s:Body>
      <PingResponse xmlns="http://tempuri.org/">
         <PingResult>SUCCESS</PingResult>
      </PingResponse>
   </s:Body>
</s:Envelope>

and the 

      fail_if_not_matches_regexp:
        - ".*SUCCESS.*"

I still get an unsuccessful probe saying:
ts=2018-05-02T14:51:18.2425291Z caller=http.go:65 module=http_2xx target=http://localhost:7778/SomeService?wsdl level=error msg="Body did not match regular expression" regexp=.*SUCCESS.*
ts=2018-05-02T14:51:18.2425291Z caller=http.go:354 module=http_2xx 

If I use method: POST, with Content-Type: text/xml, I get the following error:
target=http://localhost:7778/SomeService?wsdl level=info msg="Invalid HTTP response status code, wanted 2xx" status_code=500

I checked in the blackbox code and found the following... 


// These constants cause handlers serving metrics to behave as described if
// errors are encountered.
const (
// Serve an HTTP status code 500 upon the first error
// encountered. Report the error message in the body.
HTTPErrorOnError HandlerErrorHandling = iota
// Ignore errors and try to serve as many metrics as possible. However,
// if no metrics can be served, serve an HTTP status code 500 and the
// last error message in the body. Only use this in deliberate "best
// effort" metrics collection scenarios. It is recommended to at least
// log errors (by providing an ErrorLog in HandlerOpts) to not mask
// errors completely.
ContinueOnError
// Panic upon the first error encountered (useful for "crash only" apps).
PanicOnError
)


I was wondering, is the blackbox exporter not able to parse the SOAP response so it throws a 500? is it possible to parse a soap response or do i need to wrap my SOAP service in REST, which wouldn't be ideal since we want to call a healtchCheck function directly from a SOAP service.
Or does my soap need to expose a  `probe_success` metric in a specific format?

Any help would be really appreciated.
Thank you!
Andrée-Anne

 
On Wednesday, July 26, 2017 at 2:50:21 AM UTC-4, Brian Brazil wrote:
On 25 July 2017 at 20:45, <sivap...@evergent.com> wrote:
Could you please help me with enabling of prometheus to collect metrics   Or to use prometheus for monitoring of my SOAP endpoint url.

The check should send some post data to the endpoint & validate service uptime by matching the response with regular expression.


Look at https://github.com/prometheus/blackbox_exporter, in particular the http module's body and fail_if_not_matches_regexp parameters.

Brian
 
Soap URL - https://10.0.5.206:5055/Services?wsdl



-T text/xml -P '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="services.website.com"> <soapenv:Header/> <soapenv:Body> <ser:apiname> <arg0> <channel>grow</channel> <password></password> <userName>admin</userName> <action>VIEW</action> <urn>urn:show:fp</urn> <userToken>LZgnlF</userToken> </arg0>  </ser:apiname> </soapenv:Body> </soapenv:Envelope>

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.



--
Reply all
Reply to author
Forward
0 new messages