Monitoring FTP daemon[Solved]

Started by BlackMamba, May 21, 2013, 01:43:42 PM

Previous topic - Next topic

BlackMamba

Hello everybody!

I'm a new NetXMS user (very noob) and I'm sorry if the question has been already made, but I was unable to find an answer.

My goal is to monitor a FTP daemon (in particular, I'm using vsftpd) using NetXMS. My configuration is:

a) NetXMS server+agent installed on a virtual machine with Debian and only with the command line
b) NetXMS agent installed on a local machine (Xubuntu) where I have my FTP daemon installed and which I use to connect to the NetXMS client through web interface or Management Console.

I have this strange configuration only because I'm testing my skills, and I'm trying to "learn" NetXMS.

So, I've tried to monitor the FTP daemon using similar passages of this tutorial http://wiki.netxms.org/wiki/How_to_send_e-mail_notification_when_disk_space_is_low but I haven't been able to set up the right value on Data-Parameter in the general voice of the DCI.
Now my questions are:
1) What should I put on the Parameter voice in the DCI configuration window?
2) Is there an easiest, or righter, method to monitor a FTP daemon? If yes, could someone please explain me this method?

Thanks to all for the support!

BlackMamba

I did it!
The answer to my question (1) is: Process.Count(vsftpd). Then I set the threshold to "=0" so the agent verifies the process count and if the daemon is stopped (or down for any reason) the DCI has 0 as value and the alarm is raised. I know that it isn't a very smart solution, but at least it works!
Unfortunately I didn't figure out a easier way. If someone would like to answer to my question (2), he is welcome!

Now I have another question. I'd like to verify not only that the daemon is running, but also that the service is working. To do this, I need to connect somehow to the FTP server and verify the reply I obtain after a login attempt. Or just read the answer of the connection attempt. Is it possible to do something like that using NetXMS, possibly using the agent in the local machine (the one where I also have the FTP daemon running)?

Victor Kirhenshtein

Hi!

You can use portcheck subagent to check that network service is actually responds. There is short documentation: http://wiki.netxms.org/wiki/Subagent:PortCheck. There are no FTP support, so you can only check that TCP connection can be established.

Another option is to define external parameter on one of the agents to connect and check FTP server. It could be something like this:


ExternalParameter = FTP.Status(*):echo quit | nc -q1 $1 21 | grep '^220 .*' | wc -l


After you add this line to nxagentd.conf and restart agent, it will provide new paraneter FTP.Status, which will take server DNS name or IP address as argument, and return 1 if 220 got in response, and 0 otherwise.

Best regards,
Victor

BlackMamba

#3
Quote from: Victor Kirhenshtein on May 21, 2013, 10:02:19 PM
Hi!

You can use portcheck subagent to check that network service is actually responds. There is short documentation: http://wiki.netxms.org/wiki/Subagent:PortCheck. There are no FTP support, so you can only check that TCP connection can be established.

Yes, I did something similar. I just used ServiceCheck.Custom(IPserverFTP, 21) and the threshold is "=0". So, till I get 0 by the agent, the port 21 is open and then the service is up; once I get 1 the service is down and the alarm is raised.

Quote from: Victor Kirhenshtein on May 21, 2013, 10:02:19 PM
Another option is to define external parameter on one of the agents to connect and check FTP server. It could be something like this:


ExternalParameter = FTP.Status(*):echo quit | nc -q1 $1 21 | grep '^220 .*' | wc -l


After you add this line to nxagentd.conf and restart agent, it will provide new paraneter FTP.Status, which will take server DNS name or IP address as argument, and return 1 if 220 got in response, and 0 otherwise.

Best regards,
Victor

This solution is much smarter and works with the same logic of the first one. So, I'm twice happy: my ideas where right and I obtain also a better solution. Many thanks Victor!