Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to auto email

Status
Not open for further replies.

kristolcrawley

Programmer
Jun 17, 2002
19
US
Hi!

Is there anyway in apache to automatically send an email if a certain page is loaded? When our app server is unavailable I'd like to email our group so we know to look into it. At the moment if our app server is down we get a message but if it's just not accepting requests we don't know unless we see it or a user decides to inform us. I thought I could do this with js but it doesn't want to auto email.

It's apache for unix, not sure on the version.
 
This is more of an external monitoring function. If you apache is down its not exactly going to be able to send an email :)

Try some of the great freeware stuff like Nagios/Netsaint. We use Netsaint to monitor 50 or so machines with multiple services per machine. It can even alert of ping times etc and you can customize it ad infinitum.

formerly
 
Siberian,

The app server is unavailable, not apache. If apache or our app server is down we already get notice for that. If the app server is unavailable (blocking requests) we don't know anything. The networking people here will not install anything new for this so I have to find a different solution.
 
YOu say :

" If apache or our app server is down we already get notice for that."

Then you say :

"If the app server is unavailable (blocking requests) we don't know anything"

Aren't these the same items (to me 'blocking requests' means 'down' or are you doing 'ping' checks rather then service checks?

You can install netsaint on any machine on your LAN, it does not run on the apache server itself. It does service checks meaning it actually accesses the page over the web and logs a solid response. If it does not get a response it goes through notification levels.

This should require no help from your IT folks, just install it on any PC and let it rip.

Apache is not a notification system and has no functionality like this, it doesn't need it, products like Netsaint do a much better job.

An external monitoring tool is the only way to get solid monitoring that is mostly bulletproof.

Go to the website, give it a read and give it a try.
 
Sorry for the confusion. Apache is our webserver, we have an appserver using apache. If the app server gets to many requests it disables requests and the site no longer functions. The app server is up but it won't allow any apache requests through. Does that make more sense.

We don't have access to install anything on the servers that the web/app server runs on. It has to go through our networking team. We already have a monitoring tool, can't remember what it's called. The problem though is that nothing is technically "down". Apache's up, the app server is up, it's just not accepting requests.
 
Ok so let me try to be more clear.

1) Netsaint can monitor the page and the content of the page.
2) It makes a request to your app server.
3) The app server responds with a bad page OR never responds.
4) Netsaint will email you.

Netsaint can run anywhere on the internet, it does not need to be on the apache server.

 
Is there anyway in apache to automatically send an email if a certain page is loaded? When our app server is unavailable I'd like to email our group so we know to look into it.

What page would send this e-mail? If the server is blocking requests, what page does the user see?

Oh, and just for the record, Apache does not send e-mail. [wink]

Hope this helps


Wullie


The pessimist complains about the wind. The optimist expects it to change.
The leader adjusts the sails. - John Maxwell
 
In the apache config I set it to show a special "app not available" page when the (app) server is down. If apache's completely down obviously you'd just get the site not found, which is fine because in that instance I would have already been beeped. All I wanted is if apache is serving this "app not available" page then you know our app is not available for some reason. In that case, I want something to page us. Can't do it in js and I was hoping I could do it in apache since it knows when it can't reach the server (error log says not returning drp requests).

I'm off to write a script to just tail the stupid apache logs. Thanks anyway guys!
 
Geeze man, you are making this MUCH HARDER then it really is.

If you have a 'down' page NetSaint can detect that and send you an email. Better then that it can maintain an 'oncall list' as well as escalation parameters.

The app server gives 'All I wanted is if apache is serving this "app not available" page then you know our app is not available for some reason'

Netsaint can DETECT THIS CONDITION.

Tailing your logfile on a server that is already experiencing load problems is the -wrong solution-.

You really should just click this link :


and go read a bit on it. This is your solution.

Ah, well, the easy solution is not what you want, enjoy tailing! Watch out for out of control tail processes that swamp you.

Really, Netsaint is the way to go. We use it to monitor 5 different types of app servers, pools of app servers, proxy servers, mail servers, server pings, server latency and a ton of other parameters.
 
If you don't want to go with netsaint (and thats the way it looks) then why not include a little routine into the page that is loaded? (PHP, CF, ASP) or whatever language that you can use.

Overall, Apache can not send e-mail, so unless you have a server side language on this server and can use that to process the mail and pass it to the mail server, you're stuck.

Hope this helps

Wullie


The pessimist complains about the wind. The optimist expects it to change.
The leader adjusts the sails. - John Maxwell
 
If your app server is already dying adding an email output per page load is really going to increase the death rate.

I am assuming it dies from lack of resources.

Good luck! Hope you resolve the core issues causing your app server trouble soon.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top