DCI checks over SSH

Started by gmonk63, August 04, 2016, 04:08:29 AM

Previous topic - Next topic

gmonk63

Is there a way through scripting or other to do checks on nodes that dont either support SNMP or Agent  but have ssh access.   Since ssh supports running remote commands such as  if i run "ssh me@remotenode uname -a "  will give me system identification info  could I create a DCI that could run these remote commands via SSH to gather data ?  I have a switch that does not fully support SNMP and  only way to gather interface,cpu or temp stats is either via web or login and run a custom executable which comminticates with switch chip ...so my only options is try and scrape the data from the gui or run the custom commands over ssh and return it to NETXMS but i dont see any way to do that in the DCI setup options...



Thanks

Victor Kirhenshtein

Hi,

actually, SSH data collection will be introduced in 2.1-M1 (it is already implemented in development branch). Right now you can try to build agent with SSH support (you'll need libssh development package installed) and use SSH subagent. It provides single parameter called SSH.Command with the following arguments:

SSH.Command(host,login,password,command).

For example, to get load average from AIX machine:

SSH.Command(10.10.1.1,root,password,"uptime | cut -d : -f 4 | cut -d , -f 1")

And server version 2.1 will hide these details and allow you to create DCIs with SSH source and convert them into requests to appropriate agents.

Best regards,
Victor

gmonk63

Do i need to build the server as well or just the client  ?  How stable is the current dev branch ?

ricktendo

Wow great, any ETA on the 2.1 release?

Victor Kirhenshtein

For using SSH.Command parameter you only need to build agent. Version 2.1 will also include new data source "SSH" which will simplify configuration.

First release in 2.1 branch - 2.1-M1 - will be available in few days.

Best regards,
Victor

zorzevey

Hello,

I installed the beta version on a new VM to try version.
I want to check over ssh command.
I did it on DCI, but changed the status to UNSUPPORTED.
I used same example you gave.

What I miss?

Alex Kirhenshtein

Check that metric is provided by the agent:

nxget -I VM_IP|grep SSH

Also check agent version:

nxget VM_IP Agent.Version

zorzevey

Hello,

Here´s the result .

root@ubuntu-test:~# nxget -I 10.31.1.97 | grep SSH
ServiceCheck.SSH(*) INT "Status of remote SSH service"
ServiceResponseTime.SSH(*) INT "Response time of remote SSH service"
root@ubuntu-test:~# nxget 10.31.1.97 Agent.Version
2.1-M1


I think my agent doesn´t  support check by ssh.
How can i fix it?

Thanks

Victor Kirhenshtein

Hi,

make sure you have

SubAgent = ssh.nsm

in nxagentd.conf on 10.31.1.97.

Best regards,
Victor

frostasm

Hi Victor.

I started using NetXMS and I need to get data over the SSH protocol. I'm wondering if the ssh sub-agent is included in release version 2.1 by default or I must to build it manually?

Victor Kirhenshtein

Hi,

it seems to be missing in deb packages. We will check and re-package them to include SSH subagent. On Windows SSH subagent is included.

Best regards,
Victor