Monitor a URL which have DUO authentication

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Monitor a URL which have DUO authentication

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
ar0431
Posts: 73
Joined: Tue May 21, 2019 12:05 pm

Re: Monitor a URL which have DUO authentication

Post 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".
ar0431
Posts: 73
Joined: Tue May 21, 2019 12:05 pm

Re: Monitor a URL which have DUO authentication

Post by ar0431 »

User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Monitor a URL which have DUO authentication

Post 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'
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
ar0431
Posts: 73
Joined: Tue May 21, 2019 12:05 pm

Re: Monitor a URL which have DUO authentication

Post 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|
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Monitor a URL which have DUO authentication

Post 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'
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
jdunitz
Posts: 235
Joined: Wed Feb 05, 2020 2:50 pm

Re: Monitor a URL which have DUO authentication

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked