0

We have some servers which run server applications which are dependent on one another.

Our company wanted to implement something in each server that test periodically other servers. When one of the servers are not up so administrators are notified by email.

I décided to program it in Python and i use libnmap. So at the background my python code use nmap to do it.

What i do is scaning ports that i know our applications run on it and if they are open so i consider it OK.

At the first the Python script was executed every 1h. But someone wanted that we test it every 5 minute.

So is it a good way to do it, or it existe a better way to test server availability.

Tanks

Captain Wise
  • 480
  • 3
  • 13
  • 1
    There's a whole *industry* based on testing server availability! Personally I'd just set up a cronjob to nmap, rather than trying to script something in Python, but it's a decent application for a web tool, too. – Adam Smith Oct 07 '15 at 22:50

1 Answers1

1

Is it a good way to use nmap to test my server availability?

Definitely yes, though there might be better tools. Nmap is a good choice if you're trying to test if the server is up or not, what is the HTTP page title and so on. Its NSE script scanning capabilities make it easily extensible, but the question you'll probably want to ask is "how much work would it take to turn it into a robust availability monitor". And the answer is: a lot, because it's not just about running a query to the server.

You should probably take a look at open source montioring tools (Nagios, Zabbix etc). This way you'll avoid having to implement data gathering features, notifications that you'll probably need sooner or later and the front-end will definitely be more flexible and comfortable. There's also a lot more features that you will probably find useful.

d33tah
  • 10,999
  • 13
  • 68
  • 158
  • I looked at Nagios and I see that it's a huge system with notifications mecanisms. But is it a very demanding service to the server. I mean will this application use a big part of the CPU time? Because some servers we have have not a very fast processors and not enough memory, do you know what is the application that need less performance system. – Captain Wise Oct 16 '15 at 01:43
  • @CaptainWise: no idea, I guess I'd fire up an IRC client and ask Nagios folks directly about that (or write to their mailing list). Anyway, you can Google for lightweight open source monitoring: https://encrypted.google.com/search?hl=pl&q=lightweight%20open%20source%20monitoring - Monitorix and Amon pop up in the top results. – d33tah Oct 16 '15 at 05:18