- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Ring alarm through all logged in terminals
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2007 06:03 PM
05-22-2007 06:03 PM
I had to open another thread for this issue....
What do i do if i want to ring the alarm bell from all logged in sessions anad not from the single/current session ...where should i run this script??
In the background/cron job ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2007 06:24 PM
05-22-2007 06:24 PM
Re: Ring alarm through all logged in terminals
who | awk -F " " '{print $2}'
Integrate this with your other script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2007 06:37 PM
05-22-2007 06:37 PM
Re: Ring alarm through all logged in terminals
i tried it..but its not working..
echo "\a" > `who | awk -F " " '{print $2}'`
sh: pts/0^Jpts/1^Jpts/2^Jpts/3^Jpts/4^Jpts/6^Jpts/7^Jpts/8^Jpts/9^Jpts/10^Jpts/13^Jpts/14^Jpts/15^Jpts/16^Jpts/17^Jpts/18^Jpts/19^Jpts/20^Jpts/11^Jpts/21^Jpts/22^Jpts/23^Jpts/24^Jpts/26^Jpts/27^Jpts/28^Jpts/29^Jpts/30^Jpts/31^Jpts/32^Jpts/35^Jpts/36^Jpts/33^Jpts/39^Jpts/40^Jpts/42^Jpts/44^Jpts/45^Jpts/46^Jpts/47^Jpts/48^Jpts/49^Jpts/50^Jpts/51^Jpts/52^Jpts/53^Jpts/55^Jpts/56^Jpts/57^Jpts/60^Jpts/61^Jpts/65^Jpts/77^Jpts/79^Jpts/80^Jpts/83^Jpts/86: Cannot create the specified file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2007 06:45 PM
05-22-2007 06:45 PM
Re: Ring alarm through all logged in terminals
I'm not sure that this will work, I don't see why it wouldn't, but could you pipe the thing to wall?
yourscript | wall
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2007 06:46 PM
05-22-2007 06:46 PM
Re: Ring alarm through all logged in terminals
It is a natural question we should expect!
will have to test it. As cron is not attached to a tty, it needs some trick. You could redirect that to another tty (/dev/ttyp1) which might always be opened on a pc, etc. Cron has no terminal attached to it, so reference to terminals has controlling issues - getting a logic is most important.
What is your real requirement - how do you want it to run.
For a test you can do
#cat alarm.sh
#!/usr/bin/ksh
count=0
while [[ $count -lt 10000 ]]
do
/usr/bin/echo "\a" > /dev/ttyp1
count=$(($count + 1))
done
Put the scipt on a cron for once and test it. Open a terminal and check it with tty command. And change the script according to it (ttyp1 to your avble ttyp?). If you are testing it on a workstation it is more easy. You can control the terminals. If it is on a server you have to be more careful.
Whatever you are doing on the tty at the time of running cron might be disrupted. If something goes wrong do a
ps -ef|grep echo
and kill the echo process.
May be others might join with this thread with more tricky options.
Regards,
Rasheed Tamton.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2007 06:53 PM
05-22-2007 06:53 PM
Re: Ring alarm through all logged in terminals
do
echo "\a" > $line
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2007 07:11 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2007 08:59 PM
05-22-2007 08:59 PM
Re: Ring alarm through all logged in terminals
i did the following and put it in cron ..its running absolutely fine for me...
#cat /tmp/check_bdf.sh
function check_bdf {
bdf -l | awk '$0 !~ /^F/' |awk '{if (NF!=1){
if (NF==5){
print $4"\t" $5"\t"
}
else{
print $5"\t\t" $6"\t"
}
}}' | sed 's/'%'/''/'
}
for i in `check_bdf |cut -f1`
do
if [ $i -ge 95 ]
then
/tmp/bell_all.sh
fi
done
# cat bell_all.sh
count=0
while [ $count -lt 10 ]
do
for i in `who|awk '{printf ("/dev/"$2"\n")}'`
do
echo "FILE SYSTEM FULL--------> PLZ CONTACT SYSTEM ADMINISTRATOR......" > $i
echo "\a" > $i
done
sleep 1
count=$(($count + 1))
done
And put it in cron to tun after every 10 min...in my development server..i m going to implement this in producn server as well..
Thanks for all of guys input..i could do this finally....