[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bigsister-general] writing alarms in a file - scrip exacution


I'm not sure whether the <subject> is one of the paramters passed by the event generator.
You can find that out inserting the following code between "ln=empty" and "until...":

 echo -e "\n\
 *** > ${0} receives the following parametres:\n\
       1) ${1}\n\
       2) ${2}\n\
       3) ${3}\n\
       4) ${4}\n\
       5) ${5}\n\
"

   Costa.

-----Original Message-----
From: suppressed [mailto:suppressed Behalf Of Hasan Caliskan
Sent: 18 December 2006 16:44
To: suppressed
Subject: [Bigsister-general] writing alarms in a file - scrip exacution
Importance: High



Hi All
I have configured bb_event_generator.cfg if some ALARM accour to execute this scipt. Bigsister starts this scipt but script cannot take SUBJECT from   bigsister.
My idea is to capture only Subjet line from alert message and write them in a file
 
bb_event_generator.cfg
*.*	prio=90 down=red up=green delay=0 \
        check=1 norepeat=5 \
        keep=1 pager=/usr/bin/write_log.sh mail=parameters \
        repeatprio=10 msgmax=150 maxpermin=20

write_log.sh
#!/bin/sh
 ln=empty
 until [ "`echo "$ln" |sed -n -e "/^Subject: /p"`" != "" ]
 do
  read ln
 done
echo ${ln/#Subject: /} >> /var/log/monitoring/messages_log

-----------------------------------------------------------------
Всички гледат! Гледай и ти! www.neterra.tv/bg 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bigsister-general mailing list
suppressed
https://lists.sourceforge.net/lists/listinfo/bigsister-general


	
	
		
___________________________________________________________ 
All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease of use." - PC Magazine 
http://uk.docs.yahoo.com/nowyoucan.html


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bigsister-general mailing list
suppressed
https://lists.sourceforge.net/lists/listinfo/bigsister-general

Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.