Good morning
I have a issues with NRDP passive checks and proxy server.
This is the network architecture:
-------------------------------------> Proxy (10.0.0.70:8080) ---------------> INTERNET -------------------> Nagios XI (20.20.20.20) NRDP
| (HTTPS/HTTP) NRDP
|
|
Nagios Core ----------------------------------------------> firewall (10.0.0.19) --------------------> INTERNET
INTERNET
IP:10.0.0.10
MASK: /24
DG: 10.0.0.19
nagios.cfg:
ocsp_command=send_nrdp_service
obsess_over_services=1
obsess_over_hosts=1
ochp_command=send_nrdp_host
-------------------------------------------------------------------
command.cfg:
### NRDP ###
define command{
command_name send_nrdp_host
command_line $USER1$/send_nrdp.php --url=https://20.20.20.20/nrdp/ --token=XXXXX --host="$HOSTNAME$" --state=$HOSTSTATEID$ --output="$HOSTOUTPUT$"
}
define command{
command_name send_nrdp_service
command_line $USER1$/send_nrdp.php --url=https://20.20.20.20/nrdp/ --token=XXXXX --host="$HOSTNAME$" --service="$SERVICEDESC$" --state=$SERVICESTATEID$ --output="$SERVICEOUTPUT$"
}
------------------------------------------------
Into ./bachrc and ./bash_profile
export http_proxy="http://user:password@10.0.0.70:8080"
export https_proxy="http://user:password@10.0.0.70:8080"
When the nagios execute this commands, all checks go through to the firewall (default gateway), but if I execute this commands in the command line, the checks go through to proxy server.
I don't know why these issues happen.
Can somebody help me?
NRDP and proxy
Re: NRDP and proxy
What I think is happening is when you are running the commands from the comand line, the environment variables for the proxy are set but when the nagios server they are not set so it doesn't know to use the proxy server.
What you could do is to is to set the environment variables in the global environment.
Or, in the commands, call out the environment variable like this.
The host command
The service command
Try one of those solutions and let us know if you have any other questions.
What you could do is to is to set the environment variables in the global environment.
Or, in the commands, call out the environment variable like this.
The host command
Code: Select all
/usr/bin/env http_proxy="http://user:password@10.0.0.70:8080" https_proxy="http://user:password@10.0.0.70:8080" $USER1$/send_nrdp.php --url=https://20.20.20.20/nrdp/ --token=XXXXX --host="$HOSTNAME$" --state=$HOSTSTATEID$ --output="$HOSTOUTPUT$"
Code: Select all
/usr/bin/env http_proxy="http://user:password@10.0.0.70:8080" https_proxy="http://user:password@10.0.0.70:8080" $USER1$/send_nrdp.php --url=https://20.20.20.20/nrdp/ --token=XXXXX --host="$HOSTNAME$" --service="$SERVICEDESC$" --state=$SERVICESTATEID$ --output="$SERVICEOUTPUT$"
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NRDP and proxy
@tgriep
Thanks you it's working now, I've configured the "command.cfg" files like you said:
Host:
/usr/bin/env http_proxy="http://user:password@10.0.0.70:8080" https_proxy="http://user:password@10.0.0.70:8080" $USER1$/send_nrdp.php --url=https://20.20.20.20/nrdp/ --token=XXXXX --host="$HOSTNAME$" --state=$HOSTSTATEID$ --output="$HOSTOUTPUT$"
Services:
/usr/bin/env http_proxy="http://user:password@10.0.0.70:8080" https_proxy="http://user:password@10.0.0.70:8080" $USER1$/send_nrdp.php --url=https://20.20.20.20/nrdp/ --token=XXXXX --host="$HOSTNAME$" --service="$SERVICEDESC$" --state=$SERVICESTATEID$ --output="$SERVICEOUTPUT$"
But I don't know why it only send hosts checks passive, the nagios xi remote only receives to unconfigured objects hosts without services.
Thanks you it's working now, I've configured the "command.cfg" files like you said:
Host:
/usr/bin/env http_proxy="http://user:password@10.0.0.70:8080" https_proxy="http://user:password@10.0.0.70:8080" $USER1$/send_nrdp.php --url=https://20.20.20.20/nrdp/ --token=XXXXX --host="$HOSTNAME$" --state=$HOSTSTATEID$ --output="$HOSTOUTPUT$"
Services:
/usr/bin/env http_proxy="http://user:password@10.0.0.70:8080" https_proxy="http://user:password@10.0.0.70:8080" $USER1$/send_nrdp.php --url=https://20.20.20.20/nrdp/ --token=XXXXX --host="$HOSTNAME$" --service="$SERVICEDESC$" --state=$SERVICESTATEID$ --output="$SERVICEOUTPUT$"
But I don't know why it only send hosts checks passive, the nagios xi remote only receives to unconfigured objects hosts without services.
Re: NRDP and proxy
One thing, make sure the obsess over services it set to 1 in the nagios.cfg file.
If it is enabled, make sure you do not have the obsess disabled in any templates or services which would stop the services from sending it's data/
Do you see any errors / messages in the nagios.log file when the command is run?
Code: Select all
obsess_over_services=1
Do you see any errors / messages in the nagios.log file when the command is run?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NRDP and proxy
Good morning,
Now, it's everything working fine.
In the nagios.cfg the item ocsp was disable "#"
Thank you so much
Now, it's everything working fine.
In the nagios.cfg the item ocsp was disable "#"
Thank you so much
-
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: NRDP and proxy
It sounds like this issue has been resolved. Is it okay if we lock this thread? Thanks for choosing the Nagios forums!
Re: NRDP and proxy
Hello,
Yes, I don't have any problem.
Thank you to all
Yes, I don't have any problem.
Thank you to all