NagVis 1.4 introduces a powerful new feature called context menus. The context menus basically are right-click menus on the status icons. You can customize these menus by simply editing some template files. The template files are simple html files including some macros which are replaced during render time in NagVis.
The context menus give you the ability to improve your administrative workflow with the monitoring information dramatically. Imagine you have a NagVis map as the primary user interface to gather status information about your systems and even as a base to control your systems. Imagine you can view status information from NagVis and simply connect to the problematic systems by ssh or via terminal session by just two clicks. It is also possible to store some default recover jobs in scripts or anything else.
Take a look at this guide to get some ideas of the power of this new feature.
This is a quick how-to to add a "connect by ssh" option to the NagVis hosts context menu. Most of the changes have to be made on the client browsers to get it handle ssh connections. In this guide I am using the firefox on Ubuntu. It is no problem to get this work on other systems like Windows.
cd /usr/local/nagios/share/nagvis cp nagvis/templates/context/tmpl.default.html nagvis/templates/context/tmpl.default-ssh.htmlNow add a line to the host specific macro section like follows
<li><a href="ssh://[address]">[lang_connect_by_ssh]</a></li>The template is finished.
context_menu=true context_template=default-sshYou can set this option in the global section of a map, in a host object or even a template which is used in a host object.
about:config
in your firefox. Add some new options:
Name: network.protocol-handler.app.ssh Type: String Value: /usr/local/bin/ssh-connect-handler
Name: network.protocol-handler.expose.ssh Type: Boolean Value: true
Name: network.protocol-handler.external.ssh Type: Boolean Value: true
Name: network.protocol-handler.warn-external.ssh Type: Boolean Value: false
/usr/local/bin/ssh-connect-handler
.
#!/bin/bash xterm -e ssh ${1#ssh:\/\/*}You need to make this script executable.
chmod +x /usr/local/bin/ssh-connect-handler
ssh://<test-host>
in your browser address bar and press enter.
If an xterm with the ssh session opens everything is ok here.
With this knowledge you are ready to configure NagVis to be the core of your daily administrative and monitoring tasks. Be creative now!
We like you to give us some feedback on this feature and how you use it.