Hi all,
I want to tell you how to connect to hosts over SSH using context menu in Zabbix dashboard page.
I really missed this feature so I made it single-handedly.
As you know, scripts are executed on server side, there's no way to run "putty" on your PC that way.
I used SSH java applet "MindTerm" which I installed on Zabbix PHP front-end server, here is download link:
Download this applet and unpack to directory on server where is your Zabbix PHP front-end located.
In my example it is /var/www/html/zabbix/mindterm
After downloading and extracting, you must sign your applet with certificate.
Proper tools are provided with Java JDK package.
Here's the procedure:
Generate key:
Export key:
Check JAR file:
Sign JAR file:
Verify sign:
So, we have signed SSH applet.
How to use it?
First, create a script in Zabix Administration panel.
The script doesn't need to do anything, you may use command that does nothing,
eg.: /bin/echo "Hello world!" > /dev/null
In my example I created (for testing) a little bash script that does nothing:

And the script itself (/home/zabbix/bin/test):
We need the Zabbix "scriptid", you can find it in your browser status bar when you hover your script name on the list.
It looks like this. My sriptid=6, as you can see:

Then we need to modify Zabbix page "scripts_exec.php" in main directory of Zabbix PHP front-end.
The concept:
I want to run java applet in result message window, when I click "SSH Connect" in dashboard context menu, with specified destination host IP passed by applet parameter, without typing IP by hand.
So we need to know IP of chosen host, and our scriptid.
The modified file "scripts_exec.php" is attached to this post.
You can replace this file (backup the old one first), changing scriptid and path to applet .jar file only.
That's all.
How it works?

Do you like it?
Final words:
Remember, although applet is located on server, it runs on your desktop, so you need access to hosts you want connect to.
I always need to connect to my VPN server when I'm out of office before I use this tool to connect to servers inside my company network.
Of course your browser must support JAVA.
If you want to use this feature in IE, you will need "mindterm_ie.cab" file,
which is NOT included in MindTerm applet archive.
But it's easy to find it with google, just up to 5 min. searching.
In the same way you can add more features, eg. "VNC view" using this applet:
Any comments welcomed.
Environment used in this example: Zabbix 1.6.4 on Linux server
Have fun!
Skygge.
PS. This is my first post here. Sorry 4 my bad english. Zabbix is great!
I want to tell you how to connect to hosts over SSH using context menu in Zabbix dashboard page.
I really missed this feature so I made it single-handedly.
As you know, scripts are executed on server side, there's no way to run "putty" on your PC that way.
I used SSH java applet "MindTerm" which I installed on Zabbix PHP front-end server, here is download link:
Download this applet and unpack to directory on server where is your Zabbix PHP front-end located.
In my example it is /var/www/html/zabbix/mindterm
After downloading and extracting, you must sign your applet with certificate.
Proper tools are provided with Java JDK package.
Here's the procedure:
Generate key:
Code:
keytool -genkey -keyalg rsa -alias testkey
Code:
keytool -export -alias testkey -file testcert.crt
Code:
jar tvf mindterm.jar
Code:
jarsigner mindterm.jar testkey
Code:
jarsigner -verify -verbose -certs mindterm.jar
How to use it?
First, create a script in Zabix Administration panel.
The script doesn't need to do anything, you may use command that does nothing,
eg.: /bin/echo "Hello world!" > /dev/null
In my example I created (for testing) a little bash script that does nothing:

And the script itself (/home/zabbix/bin/test):
Code:
#!/bin/sh exit 0
We need the Zabbix "scriptid", you can find it in your browser status bar when you hover your script name on the list.
It looks like this. My sriptid=6, as you can see:

Then we need to modify Zabbix page "scripts_exec.php" in main directory of Zabbix PHP front-end.
The concept:
I want to run java applet in result message window, when I click "SSH Connect" in dashboard context menu, with specified destination host IP passed by applet parameter, without typing IP by hand.
So we need to know IP of chosen host, and our scriptid.
The modified file "scripts_exec.php" is attached to this post.
You can replace this file (backup the old one first), changing scriptid and path to applet .jar file only.
That's all.
How it works?

Do you like it?
Final words:
Remember, although applet is located on server, it runs on your desktop, so you need access to hosts you want connect to.
I always need to connect to my VPN server when I'm out of office before I use this tool to connect to servers inside my company network.
Of course your browser must support JAVA.
If you want to use this feature in IE, you will need "mindterm_ie.cab" file,
which is NOT included in MindTerm applet archive.
But it's easy to find it with google, just up to 5 min. searching.
In the same way you can add more features, eg. "VNC view" using this applet:
Any comments welcomed.
Environment used in this example: Zabbix 1.6.4 on Linux server
Have fun!
Skygge.
PS. This is my first post here. Sorry 4 my bad english. Zabbix is great!

Comment