PDA

View Full Version : SSH and Telnet mode of monitoring



jeykfroze
June 27 2011, 07:10 AM
Aside of SNMP mode of monitoring, is there any work around on this mode of monitoring(SSH and Telnet)?

rajib
June 28 2011, 03:37 PM
Hi,

You can use SSH as an alternate mechanism for collecting metrics from Linux/Solaris/AIX/other Unix servers. I am attaching a generic plug-in plug-in monitor that can be used to execute arbitrary commands on a remote server.




In order to use this script:

Extract the contents of the attached archive directly under Traverse installation directory and restart the Web Application and Data Gathering Engine components. If there are multiple Traverse servers, this should be performed on all BVE/DGE servers.
If Traverse (DGE) is installed on Linux, it will be necessary to install IPC::Run3 Perl module using following command:



yum install perl-IPC-Run3

The plug-in will appear as a new "sshcmd" monitor under Administration -> Devices -> Tests -> Create New Standard Tests
On the next screen, provide a valid login ID and password as well as a command that will yield a numerical result. For example, in the attached screenshot, the command to look for number of "sendmail" process is:



ps augxww | grep -v | grep -c sendmail

Standard disclaimer applicable.

aligzaidi
July 19 2011, 09:33 AM
Rajib,

Thanks for this useful plugin, but I’m getting permission errors.

SSH Command Runner - sshcmd/exec
Script execution error: Cannot run program "/usr/local/traverse/plugin/monitors/sshcmd/sshCommandRunner.pl": java.io.IOException: error=13, Permission denied

I here are my file permissions

drwxr-xr-x 2 root root 4096 Jul 19 11:35 sshcmd
-rwxr-xr-x 1 root root 3793 Jul 19 11:35 sshCommandRunner.pl


aligzaidi

aligzaidi
July 19 2011, 11:51 AM
Rajib,

never mind... i had to reinstall perl-IPC-Run3-0.043-4.el5.noarch.rpm then it worked...

here my 2 cents for other users.
depending on your linux version you may have to add extra to command line to remove spaces before actual result other wise you may get non nomaric value error.

who | wc -l |sed 's/ //g'
above will give you the total user logged in to the server.


Thanks,

Ali...