Web Transaction - Webinject issue

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Phil.Pearce
Posts: 52
Joined: Fri Jul 18, 2014 7:30 am

Re: Web Transaction - Webinject issue

Post by Phil.Pearce »

Hi,

Whats the difference between the two examples? cant see it?


below is what I could get out of the RAW header

Code: Select all

POST https://my.domain.com/submit-login HTTP/1.1
Host: my.domain.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/json; charset=UTF-8
X-Requested-With: XMLHttpRequest
Referer: https://my.domain.com/login
Content-Length: 89
Cookie: fsid=MWVkMGM5ODMtMjQzNC00YjRmLTk3MjEtODE1YzRlMzRjYWU4; IsUserOptedInCookie=true
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache

{"username":"[email protected]","password":"123456","stayLoggedIn":false}
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Web Transaction - Webinject issue

Post by tmcdonald »

The first example encapsulates all of the parameters into the <case> tag itself, while the second has the <case> and the closing </case> with the parameters between them.
Former Nagios employee
Phil.Pearce
Posts: 52
Joined: Fri Jul 18, 2014 7:30 am

Re: Web Transaction - Webinject issue

Post by Phil.Pearce »

Both gave same result

(Return code of 255 is out of bounds)
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Web Transaction - Webinject issue

Post by tmcdonald »

If your web app truly does log in using JSON, I think we're at a loss. Webinject doesn't seem to support "application/json" content type posting:

http://lists.op5.com/pipermail/op5-user ... 12710.html

If you can talk to the developers they might be able to come up with another login method. A straight GET or POST to a URL is the best way to handle this.
Former Nagios employee
Phil.Pearce
Posts: 52
Joined: Fri Jul 18, 2014 7:30 am

Re: Web Transaction - Webinject issue

Post by Phil.Pearce »

Yeah, last couple of days I've been trying to integrate selinium.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Web Transaction - Webinject issue

Post by sreinhardt »

Selenium is pretty fantastic. Like webinject it takes a bit to get used to it, but once done it's hard to beat. Let us know if you have questions!
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked