Forum Discussion

IT_GUY's avatar
5 years ago

Remote Pings/Port

Is there a way to have a data source like Ping (Multi) and Port (multi) but instead of running the ping/port check from the collector perspective but from the target server's perspective ?

6 Replies

  • AFAIK all DataSources run from a collector due to the agentless design of LogicMonitor. Since you can write DataSources as scripts, you can have the collector remote into the other system (via SSH or RemotePS for example), run the ping/task remotely then return the results back in LM.

  • Anonymous's avatar
    Anonymous

    I've seen one for Linux (via ssh) and one for Windows (posh) in one of our demos. Right now they don't have active discovery so you'd have to add the instances manually. Let me play with them a bit to see if I can make it so that you can specify the list of destinations via a property. Stand by...

  • 7 minutes ago, Stuart Weenig said:

    I've seen one for Linux (via ssh) and one for Windows (posh) in one of our demos. Right now they don't have active discovery so you'd have to add the instances manually. Let me play with them a bit to see if I can make it so that you can specify the list of destinations via a property. Stand by...

    Yeah, this could be accomplished with ssh or remote powershell. Would just require some extra work in adding manual instances and having proper permissions.

  • Anonymous's avatar
    Anonymous

    Ok, try these out: https://github.com/sweenig/remote-ping-dataSource 

    For Windows, as long as other PowerShell based DataSources work, this one should work.

    For Linux, ssh.user/ssh.pass or ssh.user/ssh.cert are needed.

    For ALL, a custom property (which can be applied on a device level or any parent level) called ping.targets needs to be added in the following format:

    google:8.8.8.8,gateway:192.168.1.1,server:192.168.1.100,KMC:10.0.86.46

    The above example will result in four instances named "google", "gateway", "server", and "KMC". The IP address for each item will be pinged, in parallel, and the results brought into the DS. You could set this on a group containing both Windows servers and Linux servers since the property is named the same for both.

  • I am trying to adapt this to test for smtp port using nc command in Linux, but it doesnt seem to pass the ##WILDVALUE## into my script. 

  • I updated the collection script in github to use a more reliable method of pulling in the wildvalue. Changed line 12 (first line in the main try block) to this:

        def wildvalue = (instanceProps) ? instanceProps.wildvalue.toLowerCase() : "##WILDVALUE##"

    See if making that update reliably pulls in the wildvalue by doing a `println(wildvalue)` on the next line and running it in the debug console of the collector.