Operating System - HP-UX
1833871 Members
1737 Online
110063 Solutions
New Discussion

unix machine notify my beeper

 
SOLVED
Go to solution
Jeff Hagstrom
Regular Advisor

unix machine notify my beeper

How do I use the unix machine to notify my by beeper or email about the environment of the machine. If I am running out of space in a filesystem, how do I call a beeper and notify them of the problem?
11 REPLIES 11
Doug Burton
Respected Contributor
Solution

Re: unix machine notify my beeper

Make a cron entry to look at the system every 15 (or 30 or 60) min. Check the disk size and if 90% email to root or a user (the user could be your pager email address) and if at 95% to crazy and email everybody. Depends on who you want to notify and when. A same example could have something like this in it:

if [[ $percent -ge 90 ]] ; then
mailx -s "File system full-`hostname`:$dir is at $percent%" root < /dev/null

if [[ $percent -ge 95 ]] ; then
mailx -s "File system full-`hostname`:$dir is at $percent%" your@pager.com < /dev/null
fi
fi

You may want to look here to find some good scripts:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=51050
Robert-Jan Goossens
Honored Contributor

Re: unix machine notify my beeper

Sยภเl Kย๓คг
Respected Contributor

Re: unix machine notify my beeper

I hope this is an HP9000 Machine,Install EMS,
Kind of diagonisis softwares and configure the thresholds,so that u will get alerts once the.
regards
SK
Your imagination is the preview of your life's coming attractions
Muthukumar_5
Honored Contributor

Re: unix machine notify my beeper

If you are having bdf binary then ( check whereis bdf ( bdf: /usr/bin/bdf /usr/share/man/man1m.Z/bdf.1m
)

then it is easy to do this as,

# if you want to alert when a file system running more space usage 90 then,

bdf | awk '{ if ( $5 >= 90 ) print $0 }' | mailx -S "file system Out of space`hostname;date`"

It will give hostname and time there.
Easy to suggest when don't know about the problem!
Kent Ostby
Honored Contributor

Re: unix machine notify my beeper

On the line listed above:

bdf | awk '{ if ( $5 >= 90 ) print $0 }' | mailx -S "file system Out of space`hostname;date`"

You would need to add:
you@yourpager.com < /dev/null

So:

bdf | awk '{ if ( $5 >= 90 ) print $0 }' | mailx -S "file system Out of space`hostname;date`" you@yourpager.com < /dev/null

"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
ramkumar
Valued Contributor

Re: unix machine notify my beeper

1.
if you are using storage like xp 1024 then there is an package called c-track through which you can get a alerts by beep or by leds . other wise if you can inform to the suport center automatically by configuring a modem and pc anywhere doftware . it will call the remote support center . and give the event detail in xml format.

2.
you can also use HP openview node manager through which you can get email alerts.

3. if u are using small setup with out open view and xp then u can enable quotas on the files system and assign the quotas to each user . if their quotas exceed administrator and user will be intimated .

Thanks
Ram
R. Sri Ram Kishore_1
Respected Contributor

Re: unix machine notify my beeper

Andrew Merritt_2
Honored Contributor

Re: unix machine notify my beeper

The Event Monitoring Service can be configured to send email when you run out of disk space on a filesystem, among other things. Other replies above may give the answer to how to generate a beeper notification from an email message.

To configure the EMS notifications, run SAM, and then select Resource Managment, then Event Monitoring Service. Under "Actions" you can add a new monitoring request. To select freespace on a filesystem, navigate down the Resource Hierarchy to /system/filesystem/availMb and then set the parameters for the filesystems you are interested in monitoring.

More information is in the EMS manual which is online at http://www.docs.hp.com/hpux/onlinedocs/B7612-90015/B7612-90015.html
Mike Patterson
Frequent Advisor

Re: unix machine notify my beeper

Here's a script that I've used forever with variations. (I run it every 15 min. in root's cron):

#!/bin/sh
# /usr/local/bin/sa.hp.fs
#
# Checks size of filesystems and pages when thresholds exceeded
#
umask 177
MAX_PERCENT=90
#MAX_PERCENT2=96
HOST=`hostname`
MAILLIST="root youremail@pagercompany.com"
ALARM=/var/tmp/sa.hp.checkfs.alarm
#
# NOTE: THIS SCRIPT DOES NOT LEAVE YOU ALONE UNTIL PROBLEM IS FIXED!!
#
# exclude filesystems checked by adding it to the grep in the next line.
#
for FILESYSTEM in `cat /etc/mnttab | egrep -Ev "cdrom|net" |awk '{print $2}'`;
do
PERCENT_FULL=`bdf $FILESYSTEM | tail -1 | awk '{print $5}' | sed -e 's/%//g'`
if [ $PERCENT_FULL -gt $MAX_PERCENT ]; then
echo "$FILESYSTEM on $HOST is at $PERCENT_FULL% full" >> $ALARM
fi
done
#
## Check other filesystems at different percentage
#
#for FILESYSTEM in `cat /etc/mnttab | grep ldu | awk '{print $2}'`;
#do
#PERCENT_FULL=`bdf $FILESYSTEM | tail -1 | awk '{print $5}' | sed -e 's/%//g'`
#if [ $PERCENT_FULL -gt $MAX_PERCENT2 ]; then
#echo "$FILESYSTEM on $HOST is at $PERCENT_FULL% full" >> $ALARM
#fi
#done

# Notify someone!
if [ -f $ALARM ]; then
mailx -s "$HOST SYSALARM" "$MAILLIST" < $ALARM
rm $ALARM
fi
Rick Garland
Honored Contributor

Re: unix machine notify my beeper

What has to be verified first is whether or not you can send mail from the UNIX to an outside address.

Assuming this can be done, you have all kinds of script examples to work with.

Essentially you will discover a potential issue, send that message out using sendmail to the email address of the beeper.

If you have ATT, #@att.mobile.net
If you have skytel, #@skytel.net

Ted Buis
Honored Contributor

Re: unix machine notify my beeper

System Insight Manager can do this for you. It is free from HP.
Mom 6