Try using something besides  a ; to separate the user and userlogin or better yet encapsulate them in quotes???<div><br></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); "> 'Cookie: "user=4reqrerqwr;userlogin=123adsfjlk324"'</span><br>
<br><div class="gmail_quote">On Fri, Jul 29, 2011 at 6:35 AM,  <span dir="ltr"><<a href="mailto:af.at.work@gmail.com">af.at.work@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
With cURL, I can successfully log into the website I ultimately want<br>
have Nagios test by passing --cookies.<br>
<br>
Something like this: curl --cookie<br>
"user=4reqrerqwr;userlogin=123adsfjlk324"<br>
<a href="http://mysite.com/home/index.aspx" target="_blank">http://mysite.com/home/index.aspx</a> -v | grep Welcome<br>
<br>
I know it is successful because, 1, I can visually see the rendered<br>
code and 2, the grep search for Welcome would only be seen if the<br>
authentication was successful.<br>
<br>
I am trying to mimic this in Nagios with check_http like so:<br>
<br>
./check_http -H <a href="http://mysite.com" target="_blank">mysite.com</a> -u <a href="http://mysite.com/home/index.aspx" target="_blank">http://mysite.com/home/index.aspx</a> -f<br>
follow -s Welcome -k 'Cookie: user=4reqrerqwr;userlogin=123adsfjlk324'<br>
-v<br>
<br>
One big difference I see is that in cURL the cookie is set on 1 line<br>
but the verbose response from check_http shows the cookie on two<br>
lines.<br>
<br>
Cookie: user=4reqrerqwr;userlogin=123adsfjlk324 vs<br>
<br>
Cookie: user=4reqrerqwr<br>
userlogin=123adsfjlk324<br>
<br>
I am open to suggestions and of course alternatives. I have checked<br>
out WebInject but this seems to be SO close I hate to drop it.<br>
<br>
Lastly, I have tried check_curl, and extended it to support cookies.<br>
This DOES work but I am getting (null) on the responses and the grep<br>
never causes Nagios to fail regardless of a valid result being<br>
returned.<br>
<br>
------------------------------------------------------------------------------<br>
Got Input?   Slashdot Needs You.<br>
Take our quick survey online.  Come on, we don't ask for help often.<br>
Plus, you'll get a chance to win $100 to spend on ThinkGeek.<br>
<a href="http://p.sf.net/sfu/slashdot-survey" target="_blank">http://p.sf.net/sfu/slashdot-survey</a><br>
_______________________________________________<br>
Nagios-users mailing list<br>
<a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>
::: Messages without supporting info will risk being sent to /dev/null<br>
</blockquote></div><br><br clear="all"><br>-- <br>Gary Every<br>"Pay it Forward!"<br><br>
</div>