NetXMS Support Forum

English Support => General Support => Topic started by: gmonk63 on August 04, 2016, 04:08:29 AM

Title: DCI checks over SSH
Post by: gmonk63 on August 04, 2016, 04:08:29 AM
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
Title: Re: DCI checks over SSH
Post by: Victor Kirhenshtein on August 04, 2016, 09:28:40 AM
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
Title: Re: DCI checks over SSH
Post by: gmonk63 on August 31, 2016, 05:20:10 PM
Do i need to build the server as well or just the client  ?  How stable is the current dev branch ?
Title: Re: DCI checks over SSH
Post by: ricktendo on September 05, 2016, 08:30:05 PM
Wow great, any ETA on the 2.1 release?
Title: Re: DCI checks over SSH
Post by: Victor Kirhenshtein on September 08, 2016, 11:17:34 AM
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
Title: Re: DCI checks over SSH
Post by: zorzevey on October 11, 2016, 10:18:16 PM
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?
Title: Re: DCI checks over SSH
Post by: Alex Kirhenshtein on October 14, 2016, 09:32:17 AM
Check that metric is provided by the agent:

nxget -I VM_IP|grep SSH

Also check agent version:

nxget VM_IP Agent.Version
Title: Re: DCI checks over SSH
Post by: zorzevey on October 17, 2016, 03:33:25 PM
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
Title: Re: DCI checks over SSH
Post by: Victor Kirhenshtein on October 19, 2016, 04:04:28 PM
Hi,

make sure you have

SubAgent = ssh.nsm

in nxagentd.conf on 10.31.1.97.

Best regards,
Victor
Title: Re: DCI checks over SSH
Post by: frostasm on July 13, 2017, 09:01:54 PM
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?
Title: Re: DCI checks over SSH
Post by: Victor Kirhenshtein on July 14, 2017, 10:00:14 AM
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