<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
span.StileMessaggioDiPostaElettronica17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 2.0cm 2.0cm 2.0cm;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:558130501;
        mso-list-type:hybrid;
        mso-list-template-ids:92691612 -1277540116 68157443 68157445 68157441 68157443 68157445 68157441 68157443 68157445;}
@list l0:level1
        {mso-level-start-at:10;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-font-family:Calibri;
        mso-bidi-font-family:"Times New Roman";}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=IT link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Good Morning,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>I’m currently implementing a Centreon server to monitor all our infrastructure (virtual and physical servers both windows and linux, host esx, network equipment and so on).<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>I’m trying to use the check_http plugin to monitor a web page and I’d like the plugin to behave as follows:<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span lang=EN-US><span style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>          </span></span></span><![endif]><span lang=EN-US>Opens an URL<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span lang=EN-US><span style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>          </span></span></span><![endif]><span lang=EN-US>Sends username and password when asked<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span lang=EN-US><span style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>          </span></span></span><![endif]><span lang=EN-US>On the returned page check for content (a string contained in the HTTP answer)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Everything works fine if I don’t follow redirects, so I’m able to grep a string in the first HTTPS response using the following command (sensitive data are hidden for obvious reasons):<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>[root@centreon plugins]# ./check_http -H “hostname” -u “uri” -s "string1" -f follow<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>HTTP OK: HTTP/1.1 200 OK - 38209 bytes in 0.022 second response time |time=0.021580s;;;0.000000 size=38209B;;;0<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>If I authenticate and set –f follow in order to follow the redirect, something goes wrong: I’m able to grep strings in the login page, and not in what is shown AFTER the authentication:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>[root@centreon plugins]# ./check_http -H “hostname” -u “uri” -s "string2" -f follow -a username:password<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>HTTP OK: HTTP/1.1 200 OK - 38209 bytes in 0.030 second response time |time=0.029502s;;;0.000000 size=38209B;;;0<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>[root@centreon plugins]# ./check_http -H “hostname” -u “uri” -s "string2" -f follow -a username:password<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>HTTP CRITICAL: HTTP/1.1 200 OK - string ‘string2’ not found on 'http://hostname:port/uri' - 38209 bytes in 0.028 second response time |time=0.027837s;;;0.000000 size=38209B;;;0<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Of course string1 is something that you can find in login page, string 2 is something you can find after the login.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>I don’t know if I’m not authenticating (but username and password are working and there’s no LDAP involved) or if I’m not following the redirect, because in the error I can see that the uri is always the same (HTTP CRITICAL: HTTP/1.1 200 OK - string ‘string2’ not found on 'http://hostname:port/uri').<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>How can I proceed? Is there a way to debug this?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Thanks <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;mso-fareast-language:IT'>Sara Gangale<o:p></o:p></span></b></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;mso-fareast-language:IT'>System Analyst<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;mso-fareast-language:IT'><o:p> </o:p></span></p><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;mso-fareast-language:IT'>TWT S.p.A.<o:p></o:p></span></b></p><p class=MsoNormal><span style='font-size:10.0pt;mso-fareast-language:IT'>Viale Jenner, 33 - 20159 Milano - Italy<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;mso-fareast-language:IT'>Tel +39-02-89089.288 - Fax +39-02-89089.211<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;mso-fareast-language:IT'>Mobile +39-3371158367<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;mso-fareast-language:IT'>E-mail: s.gangale@twt.it - Web: http://www.twt.it<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>