Page 2 of 2

Re: Monitor a URL which have DUO authentication

Posted: Wed Mar 25, 2020 5:20 pm
by mbellerue
Let's try the command like this.

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H satmbeist1.tamusa.tamus.edu -t Linux-tamusa -P 5693 -M plugins/check_wlsagent.sh -a "satmbeist1.tamusa.tamus.edu 9090 'username=weblogic&password=dWyRbMW3CfrzpwDDMHiqnssD&hostname=localhost&port=7001&component=BannerEventPublisher-9,1,1'"
Though I am a little confused by this. When everything reaches the check_wlsagent.sh script, it will look something like this.

Code: Select all

wget -q -O - http://satmbeist1.tamusa.tamus.edu:9090/wlsagent/WLSAgent --post-data='username=weblogic&password=dWyRbMW3CfrzpwDDMHiqnssD&hostname=localhost&port=7001&component=BannerEventPublisher-9,1,1' 2> /dev/null
This looks like it's calling the same server that check_ncpa.py is calling, only to then make a call to localhost. I don't know if that's a normal function of WebLogic or not. I guess let's try the first command, the check_ncpa command. If that works the way you want it to, great. If not, try the wget command from the remote server. Maybe also the Nagios server just to see what it returns.

Re: Monitor a URL which have DUO authentication

Posted: Thu Mar 26, 2020 7:52 am
by ar0431
Both commands giving same output.

"AdminServer is in RUNNING state, status OK"

But when I stop the "component=BannerEventPublisher" to verify these commands, these commands gave the same output. these commands should say that "component=BannerEventPublisher" has been stopped.

so its mean that these commands are not monitoring the state of "component=BannerEventPublisher".

Re: Monitor a URL which have DUO authentication

Posted: Thu Mar 26, 2020 7:55 am
by ar0431

Re: Monitor a URL which have DUO authentication

Posted: Thu Mar 26, 2020 4:45 pm
by mbellerue
It looks like things are correct based on the document and what I'm seeing here. Something isn't responding correctly. Let's continue with the wget command and see if we can change the output.

Code: Select all

wget -q -O - http://satmbeist1.tamusa.tamus.edu:9090/wlsagent/WLSAgent --post-data='username=BADUSERNAME&password=dWyRbMW3CfrzpwDDMHiqnssD&hostname=localhost&port=7001&component=BannerEventPublisher-9,1,1' 2> /dev/null
Let's try running that, and see if the output is any different.

Let's also try this one,

Code: Select all

wget -q -O - http://satmbeist1.tamusa.tamus.edu:9090/wlsagent/WLSAgent --post-data='username=weblogic&password=dWyRbMW3CfrzpwDDMHiqnssD&hostname=localhost&port=7001&component=BannerEventPublisher-9,1,1'

Re: Monitor a URL which have DUO authentication

Posted: Fri Mar 27, 2020 7:55 am
by ar0431
I gave the following command and it gives error because we gave wrong user name (BADUSERNAME).

[root@satmnagios02 ~]# wget -q -O - http://satmbeist1.tamusa.tamus.edu:9090 ... t/WLSAgent --post-data='username=BADUSERNAME&password=dWyRbMW3CfrzpwDDMHiqnssD&hostname=localhost&port=7001&component=BannerEventPublisher-9,1,1' 2> /dev/null
2|java.io.IOException: Unhandled exception in lookup


Then I gave following command which gave same output.

[root@satmnagios02 ~]# wget -q -O - http://satmbeist1.tamusa.tamus.edu:9090 ... t/WLSAgent --post-data='username=weblogic&password=dWyRbMW3CfrzpwDDMHiqnssD&hostname=localhost&port=7001&component=BannerEventPublisher-9,1,1'

0|AdminServer is in RUNNING state, status OK|

Re: Monitor a URL which have DUO authentication

Posted: Fri Mar 27, 2020 4:43 pm
by cdienger
To get some debug output, run this command:

Code: Select all

wget -d -O - http://satmbeist1.tamusa.tamus.edu:9090 ... t/WLSAgent --post-data='username=weblogic&password=dWyRbMW3CfrzpwDDMHiqnssD&hostname=localhost&port=7001&component=BannerEventPublisher-9,1,1'

Re: Monitor a URL which have DUO authentication

Posted: Fri Mar 27, 2020 5:15 pm
by jdunitz
Also, can you try changing the "1,1" at the end of that command to "1,2" instead, and see if that makes a difference? Having the warning and critical thresholds be the same can cause unexpected results.