Page 2 of 2
Re: webtranslation to monitor webpage
Posted: Tue Nov 07, 2017 10:15 am
by kyang
Before we do anything specific, it would help us to see some more information for troubleshooting.
Code: Select all
yum -y install tcpdump
tcpdump -s 0 -i any host ip.of.web.server -w output.pcap
As
@cdienger and
@dwhitfield have mentioned a tcpdump will be helpful.
Re: webtranslation to monitor webpage
Posted: Wed Nov 08, 2017 4:38 am
by pkrk
not is not helpful at all.
I had ask who to use webtranslation in nagios server , itself , so why does tcpdump is usefull for you? is redhat server with no selinux or iptables set ......
is simple test using nagiosxi , and you not able to support , based on this level of support there is no sence in thinking in buying nagiosxi ...
Re: webtranslation to monitor webpage
Posted: Wed Nov 08, 2017 9:23 am
by mcapra
I'm much more of a Selenium and PhantomJS guy when it comes to this sort of stuff. Besides better tools existing, WebInject itself is pretty long-in-the-tooth and only has a single maintainer (far as I can tell).
Here's the official docs for setting up Selenium with XI (note that a
separate machine to host the Selenium server must exist):
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
I was in the process of writing up a
CasperJS+Nagios XI document, but got distracted. I'll update this thread if I finish that in the near future.
Re: webtranslation to monitor webpage
Posted: Wed Nov 08, 2017 11:43 am
by kyang
Thanks
@mcapra!
Selenium is a good way, and is easily integrated with Nagios XI.
@pkrk Sorry about that, that's something another tech wanted to see specifically.
In your case, assuming this is what you have been looking at to get the examples.
http://www.webinject.org/plugin.html
Now I haven't tested it, but since case 1 works and case 2 doesn't. Have you tried different options?
I'll see what I can come up with when I'm testing.
Re: webtranslation to monitor webpage
Posted: Thu Nov 09, 2017 3:18 am
by pkrk
Thanks for selenium option , but we would prefer web inject as is part of nagiosxi , and we don't want to have another server with selenium.
We try to test diferente options with case 2 , but it seems that doesn't work ...
Re: webtranslation to monitor webpage
Posted: Thu Nov 09, 2017 10:11 am
by dwhitfield
@pkrk, we're having some difficulty understanding what is going on on your server.
Please run
ll -R / >> /tmp/llR.txt and then attach the file that it creates.
Also, if you could run
Code: Select all
yum -y install tcpdump
tcpdump -s 0 -i any host ip.of.web.server -w output.pcap
and send the pcap file just to verify that webinject is actually making a call, that would be very helpful. Additionally, your /etc/sudoers would be helpful and the output of
sestatus
Can you give us the exact URL you are using? This will allow us to test. At this point we are just guessing about what is happening because you aren't providing us with much information.
Lastly, can you PM me your Profile? You can download it by going to Admin > System Config > System Profile and click the ***Download Profile*** button towards the top. If for whatever reason you *cannot* download the profile, please put the output of View System Info (5.3.4+, Show Profile if older) in the thread (that will at least get us some info). This will give us access to many of the logs we would otherwise ask for individually. If security is a concern, you can unzip the profile take out what you like, and then zip it up again. We may end up needing something you remove, but we can ask for that specifically.
You can also generate a profile manually using the script at /usr/local/nagiosxi/html/includes/components/profile/getprofile.sh
That should generate a profile in /usr/local/nagiosxi/var/components/ which you can get off the server with an application such as FileZilla.
After you PM the profile, please update this thread. Updating this thread is the only way for it to show back up on our dashboard.
If you get an error that PROFILE BUILD FAILED, please see
https://support.nagios.com/kb/article.p ... ategory=44
Re: webtranslation to monitor webpage
Posted: Thu Nov 09, 2017 11:21 am
by pkrk
i will send you all this data , but it doesn't make any sense at all .... it just waste of time and effort.
i just wanna simple test case to web transaction .... god sake ... and so many data for nothing ...
are you support support ? you are helpdesk ? we are just curious to know it
the 5 or 6 emails of data are in your mailbox the tcpdump have 55M after tar.gz , do you want me to send you 56 emails of 1M each ? because the limit of you attach is 1MB
Re: webtranslation to monitor webpage
Posted: Thu Nov 09, 2017 5:58 pm
by cdienger
Doug is busy at the moment but I've looked over the thread and the sample provided. The problem seems to stem from the tests not accounting for a variable on the login page.
The first case will work using:
Code: Select all
<case
id="1"
url="http://nagios01/nagiosxi/login.php"
verifyresponsecode="200"
verifypositive="con"
errormessage="Can not display the login page."
/>
and the config file:
Code: Select all
<testcasefile>testcasefilename.xml</testcasefile>
<useragent>WebInject Application Tester</useragent>
<timeout>10</timeout>
<globaltimeout>30</globaltimeout>
<reporttype>nagios</reporttype>
The first request will return a page with a nsp variable. The second case then needs to use this variable. For example:
Code: Select all
<case
id="2"
method="post"
url="http://nagios01/nagiosxi/login.php" postbody="nsp=7231c3a4991c732416021511be5a3402a1ea744912b3461fbadc2b2a485db41c&page=auth&debug=&pageopt=login&redirect=%2Fnagiosxi%2Findex.php%3F&username=nagiosadmin&password=welcome&loginButton="
verifyresponsecode="302"
verifynegative="Authorization failed"
errormessage="Login failed."
/>
The trick is getting the variable to be used by the second request. I don't have anymore time today to test this, but hopefully will tomorrow and hopefully this is enough for you to continue testing further.
It's not clear how exactly you're testing this but you can run the webijnect command from the command line with:
Code: Select all
/usr/local/nagiosxi/etc/components/webinject testcasefilename.xml configfilename.xml
Re: webtranslation to monitor webpage
Posted: Fri Nov 10, 2017 6:38 am
by pkrk
thank you so much,
that exactly what we looking after , we will test and let you know .
Re: webtranslation to monitor webpage
Posted: Fri Nov 10, 2017 12:11 pm
by kyang
Sounds good!