Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - curruscanis

#1
Update, for anyone trying to do anything similar, I believe I have a working solution.  I was able create a polled DCI parameter from a Windows Agent using the SSH.nsm subagent to access a router / firewall and then run a script from that device ( in my case Edgerouter ).  Below is how I setup the DCI properties on the Windows Agent System:

Data - Parameter:
SSH.Command(192.168.239.1,username, password,sudo /config/scripts/polling_script.sh)

Origin:
NetXMS Agent 
   ( this differs from information online that says it should be "SSH", I could not get this to work )

Data Type:
String

Source Node:
Pointing at the Same windows Agent

I run a script that is found on the remote router / firewall that consist of a ping command that is parsed for information on if the ping is successful and returns either "OK" or "Failed"

my script is similar to this:
if ping -q -c 1 10.200.200.112 2>&1 > /dev/null ; then
    echo "Ok"
else
    echo "Fail"
fi


Thank you all for your help, this will allow me to confirm the status of VPN's that I do not control any remote devices, that only allow certain IP's to ping them.


#2
Thank you for your input Zebbie, I figured once I got any info other than <<error>> on the DCI parameter then I would begin the process of parsing the data as you recommend.

#3
Ok, I beleive I am making progress.

I have created a DCI parameter on a test PC - windows 10 running NetXMS agent with SSH.nsm subagent.

I have created a DCI parameter as follows:
Parameter:
   SSH.Command(192.168.239.1,username,password,ping 192.168.240.1)

Origin:
   NetXMS agent

Data Type:
   String

I have tried using the origin of SSH but I never get anything back. 

With the above settings I now see this in the log:



2021.02.15 08:51:45.001 *D* [comm.cs.2          ] Requesting parameter "SSH.Command(192.168.239.1,username,password,ping 192.168.240.1)"
2021.02.15 08:51:46.157 *D* [                   ] SSH: created new session [email protected]:22/2


So I am presumably getting a return of "created new session..."

How can I use this to SSH into my device, and ping another device and return the result of "successful" or "failed"?????


Thank you all for your assistance.

#4
I have continued testing with the log verbose setting to 6.  In the Agent log, that is a windows 10 system that I am attempting to use an ssh DCI parameter, the agent log does say that the SSH sub agent is loaded successfully, however the DCI parameter is never mentioned in the log.  I have other custom DCI parameters on this test machine and they do show up in the log.

#5
Thank you Victor, I will do that and review, but if you could explain to me in simple terms exactly where these items should be configured.  I presume the DCI parameter should be created on the agent PC node, not the router in question?  I am confused as to where each of these items should actually be created.
#6
I have attempted to create a DCI for a given node using only the "uname -a" under the DCI parameter.  I have the Origin set to SSH, and the Data Type to String. This is to attempt to get anything back in the DCI value.

I have attempted entering the NetXMS server and a windows 10 system running with NetXMS agent with the ssh.nsm enabled.  I have also attempted setting the windows 10 system as the SSH proxy, nether of these configurations work.

The only information that I get is an <<error>> in the value of the DCI when I force a DCI poll or just wait.

Obviously I am missing something or doing something wrong, can you assist further?
#7
I have been reading up on scripting with SSH and NETXMS and various items about NXSL without much success.

I believe what I want to do is fairly simple but I don't understand how to implement it in NetXMS.

I monitor many Unifi Edgerouters with NetXMS, some of these firewalls have VPN's to remote subnets / devices that I would like to confirm the state of the VPN as up or down.  One way to do this is to ping a device on the other end of the VPN that also has the benefit of causing traffic to keep the VPN's up.  Since the Edgerouters do not have a NetXMS agent installed I don't know how to implement a script from the device like I do with other agents.  I believe it should be just an SSH script but I don't know how to get NetXMS to fire the script and record the output.

Basically I want to be able to run an SSH script on a non agent device to ping or other functions and return information.  I would also like to do this on a schedule if possible or during polling.

Any ideas on how to implement this?
#8
Hello all, I am hoping someone can assist me with a issue that I would like to solve.  I am using NetXMS to monitor various devices and networks.  One network has an EdgeRouter Pro router / firewall that I am monitoring.  This firewall has a VPN to a remote network that I would like to alert on if the VPN is not up.  However, since it is a policy based VPN there is no interface to monitor.

The Edgerouter is basically a linux box that I can SSH into, so is there a way to run a script that I could run CLI commands via SSH to parse information to see if the tunnel is up, or possibly even force a ping / or initiate the vpn to retry?  I have not done any scripting with NetXMS so I am not familiar with where to start.

Thank you all for your assistance on this matter.




#9
I tried this, and after a bit of messing with it still no luck.  I was able to get through the "sudo make install" but the files under the folder:

pi@pi4:~/NetXMS/netxms-3.0.2258/contrib/startup/systemd $ ls
Makefile  Makefile.am  Makefile.in  netxmsd.in  nxagentd.in  README

do not include the build service file after the make.
#10
Feature Requests / Agent for Raspberry Pi ( Buster )
October 15, 2019, 11:36:37 PM
It it possible to have an ARMF capable agent install for the raspberry pi 3?

I am building various systems that use raspberry pi's to interact with physical environments and would like to be able to monitor them.

I should mention I have attempted to install the deb package that was created a while back but the prerequisites of that install conflict with my modern versions.

#11
General Support / Re: upgrade to 3.0 - from 2.2.10
September 12, 2019, 04:38:17 PM
I think I got it I had a bad entry in my sources list with the NetXMS repository.
#12
General Support / Re: upgrade to 3.0 - from 2.2.10
September 12, 2019, 04:08:24 PM
Thank you for that insight Victor, however this is the error that I get when I attempt the following:

apt-get update

..................
Reading package lists... Done
W: The repository 'http://packages.netxms.org/debian xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://packages.netxms.org/debian/dists/xenial/main/binary-amd64/Packages  404  Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.


.....................


Do you have any further advice?
#13
General Support / upgrade to 3.0 - from 2.2.10
September 11, 2019, 09:30:57 PM
Hello, I am attempting to upgrade my Ubuntu linux ( Ubuntu 16.04.6 LTS ) based NetXMS system from 2.2.10 to 3.0 

I have followed the upgrade instructions on the wiki, although it is out of date.

I have attempted the following...

Downloaded the new release and extracted it:
wget https://netxms.org/download/releases/3.0/netxms-3.0.2258.tar.gz

I then attempted to run the shell program:
sh ./configure --with-server --with-mysql

I get the following error:

....................

checking for sensors/sensors.h... no
checking curl/curl.h usability... no
checking curl/curl.h presence... no
checking for curl/curl.h... no
configure: error: libcurl is required. Check that it is installed or use --without-curl option


I do use the --without-curl option I get an error about SSL
.............
checking for sensors/sensors.h... no
checking libssh/libssh.h usability... no
checking libssh/libssh.h presence... no
checking for libssh/libssh.h... no
configure: error: libssh is required for SSH support. Check that it is installed or use --disable-ssh option



I do have Curl installed as well as SSH, I have confirmed this and dont' know why the install script is giving me these errors.

Please let me know if anyone has any advice...



#14
I am attempting to display the status of a DCI poll that I have created for a windows agent process object.  I would like to display a simple Green / Red Dot for good / bad status if the process is running or not. 

The closest I have gotten is to use a gauge - pie graph as only chart objects seem to display DCI values on the dashboards.  This does provide me a green dot if I customize the color and my process count is a value greater than zero.  However if it is zero it is just "blank" no value.

Is there a way to display a DCI value as a good / bad color indicator on a dashboard that I am missing?
#15
Well, after continuing to research this, I found out about "Object Tools" and was able to make this work.

I can now run agent side commands from my management console and web console.


Thank you again Victor for such great software!