Monitoring script (86 Views)
Reply
Super Advisor
Allanm
Posts: 287
Registered: ‎08-13-2007
Message 1 of 4 (86 Views)

Monitoring script

Hi Folks,

I am in need of a perl script which simultaneously connects to multiple hosts and ports and checks there availability based on the success or failure of making a connection on a port.

Though I have a bare bone script which does check for the health of the port on A host but I need something which checks for 50+ ports on 50+ hosts in parallel.
I want to have a script which checks for this in parallel and returns success or failure immediately for a single host/port.
Want to have a config file which keeps the information about ports and hosts separately.
The goal is to integrate this into Xymon(aka Hobbit) so that each port/host combination can be shown separately.

Going forward I want to scale this script so it can also do a POST/GET on URLs to check for the health of the applications. If this is something which you already have and can share that would be great along with the port-checker.

The other way I am thinking is to use the current script I have which checks for a single port/host to reference multiple config files each one having a combination of host/port so that if a new host/port needs to be added then I dont have to change the script.
Any new design ideas are welcome and how it can be utilized into Xymon so that the each host/port combination's status can be shown real time.

Thanks,
Allan.
Please use plain text.
Honored Contributor
Horia Chirculescu
Posts: 829
Registered: ‎07-11-2009
Message 2 of 4 (86 Views)

Re: Monitoring script

Hello,

You could use an application called Nagios. Check this link:

http://www.nagios.org/download/

It very easy to check services/hosts availability.

Best regards,
Horia.
Best regards from Romania,
Horia.
Please use plain text.
Acclaimed Contributor
James R. Ferguson
Posts: 21,184
Registered: ‎07-06-2000
Message 3 of 4 (86 Views)

Re: Monitoring script

Hi Allan:

And you are offering to pay how much?

You might look to leveraging Net::Telnet as a connection vehicle for various ports. Of course, Perl fork()s might be helpful in performing your parallel operations.

Regards!

...JRF...
Please use plain text.
Valued Contributor
Srimalik
Posts: 436
Registered: ‎11-28-2006
Message 4 of 4 (86 Views)

Re: Monitoring script

You might want to use perl threads.
Please see perlthrtut man.
abandon all hope, ye who enter here..
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation