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 <user-c2caa0a7a8d5@xymon.invalid>
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:user-61b8273d29b7@xymon.invalid 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