Good day ULF I hope you can help me again with my problem. I have a file which looks like this:
As you can see, the file contains alarms per server, wherein:
if EVENT-SET - means an alarm has occurred
if EVENT-CLEAR - means alarm has been cleared
What I want in each server, the script/parser will evaluate each line in the file then if EVENT-SET is greater that EVENT-CLEAR meaning there's an alarm and we must check it, but if it is equal status is normal. Also, it will return an output something like this:
Thanks,
rymnd_12345
---------- Post updated at 02:32 AM ---------- Previous update was at 01:44 AM ----------
FYI on my simple code:
But the problem is it just gives the total number of lines with EVENT-SET in all servers and returns only the name of the last server, see output below:
please advice...
rymnd_12345
---------- Post updated at 07:21 AM ---------- Previous update was at 04:43 AM ----------
Hi CarloM,
How can I insert in the code to test in each server if EVENT-SET is greater than EVENT-CLEAR, then that's the time it will only prompt the user that an alarm has occurred else if they are equal status is ok.
Please advice, I've tried already several times but still I can't get the output that I want.
Does anyone know of a way to force a variable name held in another variable to return the value of the first variable? Best if I give an example, that does not work:
/usr/local/bin >cat mike.sh
NUM1ref=16
NUM2ref=32
echo "=============="
for VAR in NUM1 NUM2
do
XXXX=${VAR}ref
echo $XXXX... (4 Replies)
Hi all,
Thanks in advance for your time.
I have a data file like this:
1 7.465753425
2 8.980821918
1 1.717808219
1 6.550684932
0 5.432876712
I wish to write a bash script to check both columns and output a 1 if col1==1 AND col2<3. Otherwise I want to output a 0. In the above... (5 Replies)
I have the following in my makefile:
RESULT=`../${TOOLS_ROOT_PATH}/ext_tools.sh 11`; \
set $$RESULT > tMp; \
rm tMp; \
if ; then \
echo copying external-local tool: $< \($$*\); \
mkdir -p ${EXTERNAL_LOCAL_BIN_DIR}/$<; \
cp -f... (4 Replies)
How can I evaluate a decimal value in an if statement?
echo "Enter limit:"
read limit (enter a decmal value, ie: 2.5)
decimallimit=`echo $limit+0|bc|quit`
echo $decimallimit
if
then
echo $decimallimit
else
echo "failed"
fi (4 Replies)
how do i evaluate the value of date
if ( $(date +%m) > 8 ) then
FY_STAMP=FY$(echo $(($(date +%Y) + 1)) | cut -c3-4)
else
FY_STAMP=FY$(date +%y)
fi
i want this to make the FY_STAMP increment by 1 if the month is september and up. but cant seem to make it work (3 Replies)
I have a user defined configuration file, which could contain the following type of entries:
directory_001=/a/directory/structure
pattern_001=fred*
pattern_002=*
I have a script which reads the file generically which will loop round
loop 1
genvar=”directory”
iteration=”001”
... (11 Replies)
Hi all,
I ve a script like....
TBL=employee
sql=`cat abhi.sql` \\ abhi.sql contains ------- select a from $TBL
echo $TBL
echo $sql
SQL=`echo $sql`
echo $SQL
now i want SQL as select a from employee
and as select a from $TBL
How can I achieve this?
Help appriciated (3 Replies)
Hi
I have a script in which I have several variables
var1
var2
var3
var4
etc......
and
field1
field2
field3
field4
etc.......
The script similar to this: (6 Replies)
Does anyone know any tools or how to really get something out of a core file.
I can use strings and look for certain things like out of memory.
I am trying to use adb but I can't make heads or tails from it. I guess it is my lack of know how with the adb/mdb debugger.
anything would... (3 Replies)
I apologize for the simple question but can someone please help me with how to evaluate a number?
I will be reading in a file and if a number is >= 100000000, I will do something, if not, I will exit the if statement.
Thanks in advance (1 Reply)