Problem using WebDetector in default-foreign-source.xml

JohnD Blackburn <[email protected]>
Newsgroups gmane.network.opennms.general
Message-ID <DB6PR0602MB2902B2E758825019695F5A91CBB50@DB6PR0602MB2902.eurprd06.prod.outlook.com>
Hi All,

I've come across an issue with setting up a web detector.

I've added the following to default-foreign-source.xml

      <detector name="RFINTEG-logcall" class="org.opennms.netmgt.provision.detector.web.WebDetector">
         <parameter key="port" value="80"/>
         <parameter key="responseRange" value="200-200"/>
         <parameter key="timeout" value="10000"/>
         <parameter key="path" value="/cgi-bin/logcall.pl"/>
      </detector>


And this is working and correctly detecting that URI on the server that is supposed to be serving that.  However, there is another server that automatically redirects all calls to non-existent URI's to /users/signin/

If I perform a curl on http://wrongserver/cgi-bin/logcall.pl I see the return code of 302 with a reference to /users/signin/
And of course running curl against http://wrongserver/users/signin/ is giving a return code of 200.

In the foreign source detector, I set the response range to only accept 200 as valid code thinking that it would exclude the 302, but it appears that the WebDetector is following the 302 redirect and using the response code of the re-directed URI, so is therefore incorrectly detecting this URI where it should not.

How do I stop the detector from following the redirect, and only detecting the URI if there is no re-direct?   In this case, if I get a 302, then this is not the web server I am looking for...






Regards,
John Blackburn

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-discuss mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.