[Xymon] netrc not working

Ralph M ralphmitchell at gmail.com
Fri May 22 07:27:29 CEST 2020


You may need to write a script to handle the check, especially if it does
anything tricky with Javascript or JSON.

Start with the login page:

    curl -s -S -L -b cookies -c cookies -o login_page.html -v
http://thing.mydomain.com

The -v option gets you the headers that go back and forth, in case that's
useful.  Read through the login_page.html and see what's in the login form,
and if it's just a simple POST.  Look for hidden fields to send back,

    curl -s -S -L -b cookies -c cookies -o page.html -d userid=xxxx -d
passwd=xxxx -v http://thing.mydomain.com

that's assuming the variable names in the INPUT fields are "userid" and
"passwd".  Then see what page.html contains.  Lather, rinse, repeat, until
you get to the page you're interested in.

If it *does* do anything tricky with Javascript, JSON, or anything else,
you may never be able to do it in shell scripts.  You might be able to get
something done in python or another language.

Ralph Mitchell



On Thu, May 21, 2020 at 7:28 PM Kris Springer <kspringer at innovateteam.com>
wrote:

> Hi all.  I'm trying to get xymon to log into a device we have and check
> for a keyword on a certain page.  I know how to check a site for keyword
> using 'cont', but the device requires a login and I can't seem to get it
> to work.  It's just an http device, but the
> http://username:password@1.2.3.4.com doesn't work, and neither does the
> 'netrc' file that I found in an old blog post.  Anyone know how to get
> this to work?
>
> --
> Kris Springer
>
> _______________________________________________
> Xymon mailing list
> Xymon at xymon.com
> http://lists.xymon.com/mailman/listinfo/xymon
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20200522/fbca828a/attachment.htm>


More information about the Xymon mailing list