Servicios

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
abpro
Posts: 50
Joined: Wed Feb 24, 2021 5:31 pm

Re: Servicios

Post by abpro »

dchurch wrote:
abpro wrote:./check_ncpa.py -H 10.20.10.84 -P 5693 -t RJ11tabar_nagios -M 'plugins / restart_aplicacion.bat' -a "C: \ Program Files \ Google \ Chrome \ Application / chrome.exe"
I wasn't able to lab this up. Too many quoting errors. I don't think it's possible to pass an argument with a space in it and NOT have it break it up when trying to pass it to a generalized script.

I'd make one plugin called restart_chrome.bat:

Code: Select all

@echo off
"C:\Program Files\Google\Chrome\Application\chrome.exe"
exit 0
Then call it using the NCPA plugin:

Code: Select all

./check_ncpa.py -H 10.20.10.84 -P 5693 -t RJ11tabar_nagios -M 'plugins/restart_chrome.bat'
Also, don't insert spaces surrounding your slashes. Not sure why you did that.

Also don't use forward slashes in place of backslashes. In windows they mean something completely different.





I have done what you described to me when executing it inside nagios console mode it executes it but it does not open the application
[root@ABP-VMS01P-NAG libexec]# ./check_ncpa.py -H 10.20.10.84 -P 5693 -t RJ11tabar_nagios -M 'plugins/restart_chrome.bat'
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: Servicios

Post by dchurch »

What computer user is the service running as (check this in the service options in the Windows management console)? The only way for a GUI program to pop open is if it's the same as the user currently logged in.
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
abpro
Posts: 50
Joined: Wed Feb 24, 2021 5:31 pm

Re: Servicios

Post by abpro »

Hello, thank you very much for answering
My question is .sh how to create the scrips so that nagios detects it and makes the change when executing the program in nagios
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: Servicios

Post by dchurch »

Well, you'd need to change the user that the NCPA Listener service runs as. Do that by going into the Windows services list and opening the Properties from the right-click menu on the NCPA Listener service, then modifying the setting on the Log On tab.
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
abpro
Posts: 50
Joined: Wed Feb 24, 2021 5:31 pm

Re: Servicios

Post by abpro »

dchurch wrote:Well, you'd need to change the user that the NCPA Listener service runs as. Do that by going into the Windows services list and opening the Properties from the right-click menu on the NCPA Listener service, then modifying the setting on the Log On tab.

Thanks, I want to understand is that within the nagios console of the libexec directory, what command I enter to develop a scrips for nagios to activate that complement
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: Servicios

Post by dchurch »

I'm not sure what you mean. Is there another way you can phrase it?
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
abpro
Posts: 50
Joined: Wed Feb 24, 2021 5:31 pm

Re: Servicios

Post by abpro »

dchurch wrote:I'm not sure what you mean. Is there another way you can phrase it?

Create Event Handler Script
#! / bin / sh
case "$ 1" in
OKAY)
;;
WARNING)
;;
UNKNOWN)
;;
CRITICAL)
/usr/local/nagios/libexec/check_ncpa.py -H "$ 2" -P 5693 -t "$ 3" -M 'plugins / restart_service.bat' -a "$ 4"
;;
that C
exit 0

How would it be to create the event to open the application in nagios xi??
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: Servicios

Post by dchurch »

Oh, adding the trigger to Nagios XI is covered later in the Restarting Windows Services With NCPA document, starting where it says "Create Event Handler."

Also, the script you pasted into the forum won't work; there are spaces added for some reason. When writing to a file on the server, make sure to delete all of them. E.g. replace "#! / bin / sh" with "#!/bin/sh"; replace "$ 1" with "$1" etc. And remove that weird "that C" line you added - that may cause the script to error. It's probably easier to just copy-paste the script from the PDF.
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
Locked