LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices

Reply
 
LinkBack Search this Thread
Old 10-26-2005, 02:12 PM   #1
beeblequix
Member
 
Registered: Oct 2005
Location: Tierra Firma, Earth
Distribution: Debian of course...
Posts: 191

Rep: Reputation: 30
want to set up a "page me" script


Distro/kernel: SuSE 2.4xxxxx.

I need to find out how to have an email sent to another product (HP Openview) from our Linux system when it encounters a certain problem(s) dealing with a certain application.

If the email can be set up within a shell script I'd be happy, otherwise I'm looking to have the code reworked to include an "email beeblequix" as part of the error trapping/correcting logic.

How do you folks have your systems contact you when it has a problem? What could you tell me that would help me *get woke up at 02:36 am* if a problem happens? Thx.

ß
 
Old 10-26-2005, 02:26 PM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,185

Rep: Reputation: 468Reputation: 468Reputation: 468Reputation: 468Reputation: 468
You can just use the "mail" command within your script.

echo "The <whatever> just broke. You need to get up and fix it now." | mail -s "Alert from `hostname`" beeblequix@domain.com

The stuff in quotes after the echo is the email body. The stuff in quotes after the -s is the email subject. You of course put your own info in - the above is just an example. Of course you would substitute your real domain for domain.com.

The "mail" command is followed by he "-s <subject>" then by the list of users it should be sent to. You add additional users by separating with a space.

FYI: Most cell phone companies have a way to send text message to cell phone via email. Usually it is your phone number including area code @ some domain name. For example Cingular (was AT&T) would be something like 5554446666@mmode.com. You can use that same email address in your email.

Also - If your server has /etc/resolv.conf pointed to your DNS nameservers it should find the MX record for email automatically. However you may need to edit /etc/mail/sendmail.cf to specify the "Smart Relay" host as your mail server if it has security settings preventing unspecified relays.
 
Old 10-26-2005, 03:25 PM   #3
beeblequix
Member
 
Registered: Oct 2005
Location: Tierra Firma, Earth
Distribution: Debian of course...
Posts: 191

Original Poster
Rep: Reputation: 30
Hey, thx a bunch again.

In one fell swoop your post made me realize that even though we paid a truckload for HP Ovenview (and even added new jobs in the GWBush recession of 2001)(lol)(i'm an elephant) that in this situation it's not really that necessary. Hmmm. We'll still use though because it's integral to the vision of the company. Actually I guess the reason we want Openview involved is because then everyone around here can keep their eyes on the problem until it's resolved and makes a good place to centralize problems/fixes/response time/etc.

Coolness. I can have the script then email both office and cellphones:
me, the Bossman, my backup, the Openview system, the support staff elsewhere in the company, the support staff with the company we bought the software from or whoever I wish (cue "muhahahahahaha...").

The resolv.conf file has what you mentioned:
domain xxxxxxxxxxx.com
nameserver 2xx.xx.xxx.xxx
(the parts in 'x' are overtyped; the rest is exact). So it looks like it's pointed where it needs to be. Don't know anything about the security relays.

Hmph.....it doesn't have a folder "/etc/mail/" and thus no "sendmail.cf" file. Any other place that may be located or am I going to have to have the admin make major changes? (downtime is baaaad).

ß
 
Old 10-26-2005, 04:21 PM   #4
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,185

Rep: Reputation: 468Reputation: 468Reputation: 468Reputation: 468Reputation: 468
Just do:
find / -name sendmail.cf -print

If the file is anywhere on your system that should find it. It may be in a different directory. Its possible you don't have sendmail installed but its usually there by default.

Openview or any other montoring utility has built in monitors that are typically more efficient users of system resources than your own scripts so its not really a waste of money. However to really use it you should have an Openview client for your Linux box that communicates with you Openview master. We use Nagios (free) here but I've used a lot of the HP components - Measurware and Glance are great utilities for system performance monitoring. Also have used Patrol at other sites. They all require you to do some configuration but also have a lot of builtins.
 
Old 10-28-2005, 01:37 PM   #5
beeblequix
Member
 
Registered: Oct 2005
Location: Tierra Firma, Earth
Distribution: Debian of course...
Posts: 191

Original Poster
Rep: Reputation: 30
I'm able to send myself an email from that linux guest to my office email, but not my cell phone.

Tell me if my thinking is right here: I'm not getting my text messages to my cell phone because the mycellnumber@mmode.com is not part of the allowed policy....? Do I have to include the @mmode.com domain in that sendmail.cf file in order for me to get these text messages?
 
Old 10-28-2005, 02:13 PM   #6
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,185

Rep: Reputation: 468Reputation: 468Reputation: 468Reputation: 468Reputation: 468
@mmode.com is for my Cinglular service that used to be AT&T. It is not for ALL cellphones.

You would have to ask your carrier what email address your phone has. Also it is possible you don't have text messaging service on your phone depending on your plan with your carrier. If you DO have text messaging you ought to be able to send FROM your phone to your real email address and then it will show you what address the mail came from.
 
Old 11-08-2005, 05:02 PM   #7
beeblequix
Member
 
Registered: Oct 2005
Location: Tierra Firma, Earth
Distribution: Debian of course...
Posts: 191

Original Poster
Rep: Reputation: 30
followup.

I've got my script emailing a number of employees when certain critical problems arise. As far as paging my cell phone -- I'm handling that via Groupwise. I'll just have the original email show up in my Groupwise mailbox and then set up rules to search for specific emails from a specific user with a specific hard-coded subject....when it finds those parameters Groupwise will email my cellphone and I'll get the page. I'm double covered in another way -- one of the emails will go to an operator who has procedures to contact me with problems.

Thanks a bunch.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script: using "select" to show multi-word options? (like "option 1"/"o zidane_tribal Programming 5 10-26-2011 01:52 PM
squirrelmail "error in login page"" when content advisor is enabled simi_virgo Linux - Networking 4 08-21-2008 01:25 PM
How to set the size of icons for "Starterbar" in "Gdekslets" Blue Jacket Linux - Software 4 11-23-2005 02:42 AM
my web browser "mozilla fire fox" isn't rendering the page, rather opening the page amolgupta Linux - Software 2 07-26-2005 12:41 AM
Can't install "glibmm" library. "configure" script can't find "sigc++-2.0&q kornerr Linux - General 4 05-10-2005 02:32 PM


All times are GMT -5. The time now is 01:07 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration