Page 1 of 1

WebInject help needed to query an API with User/Password

Posted: Fri Mar 02, 2018 5:03 pm
by kevinmjacobsen
Hey all,

I'm hoping this is a quick and easy solution.

I have an API on another monitoring solution that I want to run a check every so often to verify collection status (huge enterprise/multiple tools).

I'm pretty sure Web Inject is my only option in the current Nagios XI version.

I have no idea about the WebInject stuff as I've never worked with it. I can't seem to find a good example and am hoping for some help from y'all.

Here is my basic info:

url - https://othertool/api/get/adapter/ (this can be done via pyton so I know the path is right).
user - ouruser
pass - ourpass
value to match - Adapter1

So what will the xml look like? I'm not sure where to put in the user/pass info. I'm not sure what I need to do to check for success/failure.

Just some basic guidance to help me get at least one of these valuable scripts/test in place so we have a template for hundreds of other API tests our users want from us.

Thanks for any help!

Kevin

Re: WebInject help needed to query an API with User/Password

Posted: Fri Mar 02, 2018 5:23 pm
by scottwilkerson
If it is http authentication you would use the following
http://www.webinject.org/manual.html#cfghttpauth

If it is session based it get more complicated
http://www.webinject.org/manual.html#sesscookie

there are some testcases for example you can refer to
http://www.webinject.org/manual.html#tcsetup