Page 2 of 3

Re: How can use complex password in check_http for url

Posted: Mon Jul 08, 2024 4:01 am
by kg2857
You probably need to escape the password, as has been suggested.

Re: How can use complex password in check_http for url

Posted: Mon Jul 08, 2024 8:48 am
by lgute
Hi @baber, thanks for reaching out.

I think there is a bit of confusion about what you are trying to do.
  • Are you running XI and using NRPE to run the check_http plugin, remotely on "myurl.com"?
  • Did you install the "Nagios XI Linux NRPE Agent" tarball or did you install NRPE from source?
  • Can you use check_http, without using NRPE?
If you need/want more expedient help you can open a case on Answer Hub. While most of the answers here are coming from Nagios staff, this forum is intended to be a "community support" tier. The ticket support system will allow the Support Team to dig into your environment and help you troubleshoot exactly what's happening.

For those asking about the two commands run together in the check_command, this is how the NRPE wizard sets up service definitions for check_nrpe and the plugin that it is requesting Nagios Remote Plugin Executor to execute. See Monitoring Hosts Using NRPE.

As this diagram shows, check_nrpe is executed on the monitoring (XI) server and contacts NRPE running on the "remote" server. NRPE then runs the "check command" requested by check_nrpe.
nrpe.png

Here is an example of a default service setup by the NRPE wizard.

Code: Select all

define service {
    host_name                192.168.58.241
    service_description      Current Load
    use                      generic-service
    check_command            check_nrpe!check_load! -a '-w 5,10,15 -c 10,20,30'!!!!!!
    max_check_attempts       5
    check_interval           5
    retry_interval           1
    check_period             xi_timeperiod_24x7
    notification_interval    60
    notification_period      xi_timeperiod_24x7
    contacts                 nagiosadmin
    _xiwizard                nrpe
    register                 1
}
Which translates to...

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 192.168.58.241 -t 30 -c check_load  -a '-w 5,10,15 -c 10,20,30'

Re: How can use complex password in check_http for url

Posted: Tue Jul 09, 2024 12:58 am
by baber
Actually I am using nagios core . Is there any solution for that ?

Re: How can use complex password in check_http for url

Posted: Tue Jul 09, 2024 1:06 am
by baber
As I said it is working on nagios server manually such as follow

Code: Select all

[root@nagios ~]# /usr/local/nagios/libexec/check_http -H mb.com -w 5 -c 10 -p 8980 -u /mb/ai/branch/all -a mba:785\!"@"Nobv
HTTP OK: HTTP/1.1 200 OK - 11413 bytes in 0.017 second response time |time=0.017223s;5.000000;10.000000;0.000000 size=11413B;;;0

but when I use it in config file such as follow it does not work

Code: Select all

define service{
        use                     local-service
        host_name               subs
        service_description     mebp
        servicegroups           OD
        check_command           check_nrpe!check_http!' -H mb.com -w 5 -c 10 -p 8980 -u /mb/ai/branch/all  -a mba:785\!"@"Nobv'
}


Re: How can use complex password in check_http for url

Posted: Tue Jul 09, 2024 1:17 am
by kg2857
You're running check_http directly on the nagios server, but the command is running check_http via nrpe on the http server. These aren't the same. Try getting rid of the check_nrpe part in the command. This was suggested several posts back.

Re: How can use complex password in check_http for url

Posted: Tue Jul 09, 2024 1:20 am
by baber
Would you please help me how can correct it ?

Re: How can use complex password in check_http for url

Posted: Tue Jul 09, 2024 1:30 am
by kg2857
Edit the service in CCM, change the command from nrpe to http, and change the arguments as needed.

Re: How can use complex password in check_http for url

Posted: Tue Jul 09, 2024 1:38 am
by baber
I changed it such as follow

Code: Select all

define service{
        use                     local-service
        host_name               subs
        service_description     mebp
        servicegroups           OD
        check_command           check_http!' -H mb.com -w 5 -c 10 -p 8980 -u /mb/ai/branch/all  -a mba:785\!"@"Nobv'
}

Is that correct ?

Re: How can use complex password in check_http for url

Posted: Tue Jul 09, 2024 2:18 am
by kg2857
What happens when it runs?

Re: How can use complex password in check_http for url

Posted: Tue Jul 09, 2024 2:29 am
by baber
It is showing

HTTP WARNING: HTTP/1.1 400 Bad Request - 309 bytes in 0.001 second response time
Performance Data: time=0.000723s;;;0.000000 size=309B;;;0
Current Attempt: 4/4 (HARD state)

but when run it manually from nagios server shows :

Code: Select all

HTTP OK: HTTP/1.1 200 OK - 11413 bytes in 0.010 second response time |time=0.009974s;5.000000;10.000000;0.000000 size=11413B;;;0