How to login in to http website and check the pages
How to login in to http website and check the pages
Hi All,
I need a help, I am not able to monitoring my website pages after login in to the website.
Can anyone help me here I can do this on nagios core.? Currently, I am using nagios core 4.3.2 version on my Ubuntu 16.04 LTS.?
Currently I am using this command.
./check_http -I www.abc.com -H www.abc.com -p 8000 -u /t/XYZSolutions/views/XYZSolutions/NewMenu -P "usernamefield=test&passwordfield=1234"
Can anybody correct me here If I am wrong.?
I need a help, I am not able to monitoring my website pages after login in to the website.
Can anyone help me here I can do this on nagios core.? Currently, I am using nagios core 4.3.2 version on my Ubuntu 16.04 LTS.?
Currently I am using this command.
./check_http -I www.abc.com -H www.abc.com -p 8000 -u /t/XYZSolutions/views/XYZSolutions/NewMenu -P "usernamefield=test&passwordfield=1234"
Can anybody correct me here If I am wrong.?
Re: How to login in to http website and check the pages
Without knowing more about your specific configuration or requirements, it's hard to say. It would help to know what error condition you are experiencing that makes you think it is not working.
Re: How to login in to http website and check the pages
My requirement is that I have to login into a website using my login credentials and after logging in to a website one page should come with some information but sometimes what does happen, It appears some blank page (Simple white page) without any information.
If I face such type of problem in future then I have to trigger an alert. This is my requirement.
Please let me know if you need more information regarding this.
If I face such type of problem in future then I have to trigger an alert. This is my requirement.
Please let me know if you need more information regarding this.
Last edited by Ravikimt on Mon Apr 30, 2018 9:59 am, edited 1 time in total.
Re: How to login in to http website and check the pages
My first question is, are you truly going to www.abc.com or is that just an example?
Second, what happens when you go to a web browser and type in http://www.abc.com/t/XYZSolutions/views ... ns/NewMenu? Do you get a popup username/password prompt, or is two fields on the page that you have to enter? If it's two fields on the page, then this won't work for Nagios. Nagios can only authenticate with Basic WWW Auth (the popup window). If it's part of a form on the screen that you have to enter, then Nagios cannot process that and you will have to use some sort of synthetic web transaction monitoring tool like WebInject. This would probably be beyond the assistance you would get in the general support forum here.
Second, what happens when you go to a web browser and type in http://www.abc.com/t/XYZSolutions/views ... ns/NewMenu? Do you get a popup username/password prompt, or is two fields on the page that you have to enter? If it's two fields on the page, then this won't work for Nagios. Nagios can only authenticate with Basic WWW Auth (the popup window). If it's part of a form on the screen that you have to enter, then Nagios cannot process that and you will have to use some sort of synthetic web transaction monitoring tool like WebInject. This would probably be beyond the assistance you would get in the general support forum here.
Re: How to login in to http website and check the pages
Also:eloyd wrote:you will have to use some sort of synthetic web transaction monitoring tool like WebInject.
Selenium (I know the doc says "Nagios XI" but this is also applicable to Nagios Core)
And I wrote a really rough plugin that runs and parses CasperJS tests: https://github.com/mcapra/nagios-check_casperjs
But the main answer to this question if you're not using basic authentication is that you'll need some sort of third party integration beyond the standard Nagios plugins. If the site is using basic authentication, check_http can handle that:
Code: Select all
-a, --authorization=AUTH_PAIR
Username:password on sites with basic authentication
-b, --proxy-authorization=AUTH_PAIR
Username:password on proxy-servers with basic authentication
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: How to login in to http website and check the pages
This www.abc.com just for an example.
Once I type this URL (This is not a exact url , I have modified the url ) http://www.abc.com/t/XYZSolutions/views ... ns/NewMenu? on web browser. I get a page with two fields username and password then I have to enter my credentials. Yes it's a part of the form
So I can't monitor this page right so can you please provide me some links for synthetic web transaction monitoring tool like WebInject so I can go through that it will be easy for me.
Once I type this URL (This is not a exact url , I have modified the url ) http://www.abc.com/t/XYZSolutions/views ... ns/NewMenu? on web browser. I get a page with two fields username and password then I have to enter my credentials. Yes it's a part of the form
So I can't monitor this page right so can you please provide me some links for synthetic web transaction monitoring tool like WebInject so I can go through that it will be easy for me.
Re: How to login in to http website and check the pages
The official WebInject documentation is reasonably good for getting started:
http://www.webinject.org/plugin.html
http://www.webinject.org/plugin.html
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: How to login in to http website and check the pages
The link provided by @mcapra includes an example on authenticating against a site. Let us know if you have any trouble setting the check up.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
- Bryan Quesada
- Posts: 6
- Joined: Wed Nov 05, 2014 10:23 am
- Location: Costa Rica
- Contact:
Re: How to login in to http website and check the pages
Example with curl
### Example POST Data
### send POST DATA, User Agent and redirs(with cookie)
[bryan@Tornado ~]$ curl -k -v -b cookie.txt -c cookie.txt --max-redirs 10 --data "username=user1&pass=user1234Q&profile=1" "https://sitea/login/" -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:59.0) Gecko/20100101 Firefox/59.0"
### Example POST Data
### send POST DATA, User Agent and redirs(with cookie)
[bryan@Tornado ~]$ curl -k -v -b cookie.txt -c cookie.txt --max-redirs 10 --data "username=user1&pass=user1234Q&profile=1" "https://sitea/login/" -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:59.0) Gecko/20100101 Firefox/59.0"
Re: How to login in to http website and check the pages
Which will still likely not work if the site doesn't use <form> data to process the login. AJAX, for instance, will fail this type of check, and there may be a page that has to be logged in to and then a second page to pull the appropriate results. Synthetic web transactions are really the only way to properly cover the bases.