Team,
recently we have purchased the license, but we are unable to find the option to create new post in the customer support forum. Is there any process to link the the ID with my license.
we are configuring event handler to restart an application using a script at the client end..
the script has to be run as a service user and we don't have the prviledge of sudo acess for nagios user to switch to the serviceuser. We have used expect option in client side script as an option.
1. In the Nagios CCM > Commands
created a "commands" named "applicaiton_start"
command line "$USER1$/application_start $SERVICESTATE$ $HOSTADDRESS$"
2. In nagios server created the below execution file
/usr/local/nagios/libexec/application_start
content for CRITICAL case set as below
CRITICAL)
/usr/local/nagios/libexec/check_nrpe -H "$2" -c application_start
3. On client side
/usr/local/nagios/etc/nrpe.cfg
command[application_start]=/bin/bash /usr/local/nagios/etc/applicationstart.sh
4. Content of applicationstart.sh is as below
I am able to run the below script as nagios user and the service is getting started as serviceuser. But when we run the command from nagios server script is not getting triggered.
#!/usr/bin/expect -f
set timeout 180
spawn ssh -l serviceuser va1313.xyz.com
#expect "(yes/no)?"
#send "yes\r"
expect "assword:"
send "abc@20\r"
expect "$"
#send "bash /usr/local/nagios/etc/application.sh\r"
send "cd /apps/service/dev/bin/\r"
expect "$"
send "nohup java -Xms512m -Xmx1536m -jar commission-service*.jar --spring.data.mongodb.uri=mongodb://appuser:[email protected]:27099/S......
expect "$"
Thank you
Event Handler with out sudo
Re: Event Handler with out sudo
You should contact the sales team. You can email them at sales at nagios dot com. All they should need is an email from the address you have on-file and the forums username you wish to whitelist.nagios_ant wrote:we are unable to find the option to create new post in the customer support forum. Is there any process to link the the ID with my license.
I suspect the NRPE process is going to have problems navigating expect and that is likely the root of your problems. I don't have a lab environment to test this on currently, though.
What does check_nrpe by itself output when you execute it from the CLI of the Nagios Core machine:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H "host_name_here" -c application_startFormer Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Event Handler with out sudo
In addition to @mcapra's post...
Are you using https://assets.nagios.com/downloads/nag ... h_NRPE.pdf to set this up?
That's not literally your entire nrpe.cfg, is it?nagios_ant wrote: 3. On client side
/usr/local/nagios/etc/nrpe.cfg
command[application_start]=/bin/bash /usr/local/nagios/etc/applicationstart.sh
Are you using https://assets.nagios.com/downloads/nag ... h_NRPE.pdf to set this up?
-
nagios_ant
- Posts: 17
- Joined: Tue Jul 11, 2017 2:03 am
Re: Event Handler with out sudo
Thank you for the time and support.
As suggested i am sending an email to the support team to add the user name.
I was able to figure out the problem doing multiple iterations .
as i am using 'expect option' in the local script file /bin/bash entry has to be removed in the nrpe.cfg
thank you both for the support.
As suggested i am sending an email to the support team to add the user name.
I was able to figure out the problem doing multiple iterations .
as i am using 'expect option' in the local script file /bin/bash entry has to be removed in the nrpe.cfg
thank you both for the support.
-
nagios_ant
- Posts: 17
- Joined: Tue Jul 11, 2017 2:03 am
Re: Event Handler with out sudo
@dwhitefiled
yes i am following the below document, but not using the sudo option.
--- Are you using https://assets.nagios.com/downloads/nag ... h_NRPE.pdf to set this up?
Thank you for the time
yes i am following the below document, but not using the sudo option.
--- Are you using https://assets.nagios.com/downloads/nag ... h_NRPE.pdf to set this up?
Thank you for the time
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Event Handler with out sudo
I just want to be clear. Is your issue resolved? If not, what issue are you still seeing?nagios_ant wrote: I was able to figure out the problem doing multiple iterations .
-
nagios_ant
- Posts: 17
- Joined: Tue Jul 11, 2017 2:03 am
Re: Event Handler with out sudo
@dwhitfiled
yes the issue is resolved.
I removed/bin/bash from the below configuration,
with 'expect' option used in the script file, bash was throwing the error.
command[application_start]=/bin/bash /usr/local/nagios/etc/applicationstart.sh
yes the issue is resolved.
I removed/bin/bash from the below configuration,
with 'expect' option used in the script file, bash was throwing the error.
command[application_start]=/bin/bash /usr/local/nagios/etc/applicationstart.sh