Page 1 of 1
Event Handler to run cleanup script at server end
Posted: Mon Feb 12, 2018 4:34 pm
by dlukinski
Hello XI Support
How we could configure EenetHandler to run TMP files cleanup script at Windows (NSClient) or Linux (NRPE) server end?
- any .sh file you've got and what would be the arguments?
Thank you
Re: Event Handler to run cleanup script at server end
Posted: Mon Feb 12, 2018 6:05 pm
by npolovenko
Hello,
@dlukinski. Do you only need help setting up the event handler or are you looking for a windows/linux script to clear out tmp files as well? If you do have scripts already, please upload them here, if you don't you need to find them or write your own. For linux I'm sure you could write a one-liner using shell to clear out some temp directory. On windows, you could use VB, Powershell Script or a Batch script. I'm not sure what is your criteria for deleting those files, but there should be some scripts online.
Let me know when you find the scripts and we can move forward to create the event handlers.
Re: Event Handler to run cleanup script at server end
Posted: Tue Feb 13, 2018 10:26 am
by dlukinski
npolovenko wrote:Hello,
@dlukinski. Do you only need help setting up the event handler or are you looking for a windows/linux script to clear out tmp files as well? If you do have scripts already, please upload them here, if you don't you need to find them or write your own. For linux I'm sure you could write a one-liner using shell to clear out some temp directory. On windows, you could use VB, Powershell Script or a Batch script. I'm not sure what is your criteria for deleting those files, but there should be some scripts online.
Let me know when you find the scripts and we can move forward to create the event handlers.
I am actually wondering if there is anything already exists for Nagios events
Logic is that once some DISK check threshold hits WARNING level, the event handler initiates the script
- need no script, just how to configure Nagios to run some .sh or .py / .cmd or .vbs at client end via the Handler
- how to configure handler comment?
Re: Event Handler to run cleanup script at server end
Posted: Tue Feb 13, 2018 2:53 pm
by cdienger
check_nrpe or
check_by_ssh can be used to execute remote scripts. Essentially you just make a new command to either of these and they in turn run the clean up script.
https://assets.nagios.com/downloads/nag ... ios-XI.pdf covers this.
https://support.nagios.com/kb/article/n ... h-247.html and
https://support.nagios.com/kb/article/n ... t-528.html have more details on setting up check_by_ssh and nsclient++ to run external scripts.
No sure what you mean by configuring handler comment - can you clarify?
Re: Event Handler to run cleanup script at server end
Posted: Tue Feb 13, 2018 4:35 pm
by dlukinski
I do not understand how to create comment for execution of the remote script (both Windows and Linux end)
Could we please schedule remote session for that (make it a ticket)?
- this is something we are planning to use globally and would like to get it done right the first time
Please help
Re: Event Handler to run cleanup script at server end
Posted: Tue Feb 13, 2018 5:17 pm
by cdienger
Assuming you're using nsclient++ you would want to create a command with a command line like "
$USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c <scriptname>" and use
https://support.nagios.com/kb/article/n ... t-528.html to configure the client to execute it. If this doesn't help resolve the question, please open a ticket and we can schedule a remote if needed.