Services Monitor

This is a script for monitoring services on remote hosts written in perl and PHP. It used www clients and databes MySQL in order to add new records and manage databases. I was created long time ago just to practise perl. Of course it never replace the real tools as Cacti, Nagios or Zabix.

It contains:
– engine perl script
– perl installation script
– php scripts for management and showing results

Engine is the perl script based on the modules: Net::Ping and Net::DNS and module for database handling MySQL – DBI. Module Net::Ping use icmp protocol and require root.

Requirements

WIN32 version: – Active Perl and additional modules (DBI::mysql, Net::DNS) – Web Server with php (IIS, Apache)
– MySQL

Linux version: – Perl that is in any distribution
– Apache and php
– MySQL

User have to install web server with php and MySQL before install scripts. See below into section Install for details.

Install:

Win32

1. Install Web Server with php. It depends on which server you install.
For details see into documentation.
2. Install a MySQL database
3. Install Active Perl.
You can get it from the: http://www.activestate.com/Products/ActivePerl/
4. Install additional modules:
write in perl terminal:

ppm
and then

ppm> install Net::DNS
ppm> install DBI::mysql

5. Please modify scripts pytaj.pl and install.pl in order to
change:
– correct MySQL IP address (default is localhost)
– path to perl.exe
– correct bind address
6. Copy index.php and state.php to some web directory.
7. Run install script in perl terminal:

c:\Perl\bin\perl.exe install.pl

Script ask for root password to mysql database in order to create
databases, tables and new user.
8. Now you should run index.php and add new hosts.
9. Run pytaj.pl script

c:\Perl\bin\perl.exe pytaj.pl

Linux

1. Install Apache and php. It depends which distribution you have.
For details see into documentation.
2. Install MySQL from your distribution .
3. Install Perl from your distribution.
4. Install additional perl modules and dependences, as root write:

# perl -MCPAN -e shell
cpan> install DBI
cpan> install Net::DNS

5. Please modify scripts pytaj.pl and install.pl in order to
change:
– correct MySQL IP address (default is localhost)
– path to perl binary
– correct bind address
6. Copy index.php and state.php to some web directory.
7. Run install script in perl terminal:

# perl install.pl

Script prompts for root password to mysql database in order to create
databases, tables and new user.
8. Now you should run index.php and add new hosts.
9. Run pytaj.pl script as root (Net::Ping icmp require root rights)

# perl pytaj.pl

NOTE: The best way is adding pytaj.pl script to crontab. You can do:

# chown u+x pytaj.pl
# cp pytaj.pl /etc/cron.hourly/

Download:
Services Monitor

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s