logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Third-party Modules View previous topic :: View next topic
Reply to topic   Topic: Apache 2.2.x snmp module
Author
sjepsen



Joined: 24 Dec 2008
Posts: 1

PostPosted: Wed 24 Dec '08 6:32    Post subject: Apache 2.2.x snmp module Reply with quote

Maybe an old question, did not see any good info from search, so here it goes. We just purchased SolarWinds for snmp monitoring of our services, application and hardware. The mod_snmp module I have found from google search does not work in versions 2.2.x.

What are my options to monitor the apache server running on Linux ? I would like to track every 5 minutes the number of sessions and child process (MPM).

thanks...
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Thu 05 Mar '09 13:20    Post subject: Reply with quote

I check my server with a PHP script. I also check other services with that.

Code:

function check_server($server, $port, $name) {
   preg_match("/^(http:\/\/)?([^\/]+)/i", "$server", $match);
   $host = $match[2];
   preg_match_all("/\.([^\.\/]+)/",$host, $match);
   $matches[0][0] = $matches[1][0];
   $host = trim($host);
   $socket = "";
   $socket = fsockopen("$host", $port, $errno, $errstr, 2);
   if(!$socket) {
      echo "\n".'<br /><img src="offline.gif" alt="" />'.$host. ' ' .$name; 

   }
   else
   {
      fclose($socket);
      echo "\n".'<br /><img src="online.gif" alt="" />'.$host. ' ' .$name;
   }

}

check_server('192.168.0.1','80','http');
check_server('192.168.0.1','110",'pop3');
check_server('127.0.0.1','443','https');
check_server('192.168.0.1','3306','MySQL');


I think you can modify that script to that it sends an email to you if needed.
Back to top


Reply to topic   Topic: Apache 2.2.x snmp module View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules