Page 1 of 1

User Tools Config

Posted: Mon Apr 15, 2019 11:10 am
by dfmco
Can this be a Linux command? Does it need to be a Python or Perl script? If a command, can we send a command line parameter as a variable or send the host IP of the alert source to that command line. I would like to do this: When an alert hits, I would like that alert have the IP captured and send it to an ansible command line as the host parameter. This would happen when the user when to the user tools section and ran the tool that pulls logs for instance.

Re: User Tools Config

Posted: Mon Apr 15, 2019 4:23 pm
by ssax
Please explain in detail (include screenshots if you can) of what you are talking about, we're having a hard time deciphering what exactly you're referring to.

It sounds possible but I don't know what "User Tools Config" is.

Thank you!

Re: User Tools Config

Posted: Mon Apr 15, 2019 4:42 pm
by dfmco
I can see a way to add a tool via a url:
Add Common Tool
Use this form to define a new tool that can be quickly accessed from Nagios.

What I am trying to figure out is what kind of tools can be used and how they can be used.

What I would like to do is make tools in Ansible, Python and/or Bash and publish to the Nagios server. I would like to know if there is any ability to pass variables back and forth to these tools to and from Nagios. Here are some examples of things that would be useful.

An Ansible job that can connect to a Cisco router and return stats and logs.
A Python script that can filter logs from a router or firewall and present information to a user.
A job that runs when receiving an SNMP trap that passes the information from the Trap to get more information from the router (like logs or interface counters).

Because only URL is listed in the "add tool" page, my guess is that these tools can only be started from a URL. Could that URL be an API call? If so, how could I pass variables to that API call so that the tool can be generic enough to run for any host?

Can I run other commands from the Common Tools section that are not URL based like a Bash script or Ansible command that I have to set up in the CLI as opposed to the GUI? I am trying to understand how flexible and powerful the Common Tool function is and how to use effectively.

Re: User Tools Config

Posted: Wed Apr 17, 2019 8:57 am
by ssax
Correct, they are just URL links, you could technically add any type of URL you'd like, whether that be an API call or some other local web page that calls a local script, it's entirely at your discretion. You can write components that integrate into the tools menu, you can see box293's Performance Data Tool here as an example:

https://exchange.nagios.org/directory/A ... ol/details

But I don't think the Tools menu is what you're looking for, I'd probably use the Actions component, it's likely do most of what you want, see here:

https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Read that and let us know if you have any questions.

Re: User Tools Config

Posted: Wed Apr 17, 2019 11:20 am
by dfmco
Actions seems to be a perfect fit for what I am trying to do. Thanks! Please close the post.

Re: User Tools Config

Posted: Wed Apr 17, 2019 1:00 pm
by benjaminsmith
Actions seems to be a perfect fit for what I am trying to do. Thanks! Please close the post.
Great. Closing. Thank your for using the Nagios Support Forum.