Hi folks,
could you help me out on a little problem ?
Here's what I'm trying to do:
Let's say I'd like to check several conditions which can only be "0" and "NOT 0". The results are supposed to be displayed in a row. Like that:
So far no problem because I was able to accomplish this using
In that scenario this leaves me with 12 if clauses (Not good, but still managable ;-) ). But now I'd like to extend the whole thing like this:
Problem: If I would use the if clauses structure from above this would become way too complex. Is there an elegant way around this I could use instead ?
Regards
Thomas
could you help me out on a little problem ?
Here's what I'm trying to do:
Let's say I'd like to check several conditions which can only be "0" and "NOT 0". The results are supposed to be displayed in a row. Like that:
Code:
|System1 |System2 |
------------------------------|
Archiver1 |Errors |No Error |
Archiver2 |No Error |No Error |
Archiver3 |No Error |Errors |
So far no problem because I was able to accomplish this using
Code:
if [ $check1system1 -eq 0 -a check1system2 -eq 0 ];
then
echo "Archiver1 | No Error |No Error |"
fi
if [ $check1system1 -eq 0 -a check1system2 -ne 0 ];
then
echo "Archiver1 | No Error |Errors |"
fi
and so on ...
In that scenario this leaves me with 12 if clauses (Not good, but still managable ;-) ). But now I'd like to extend the whole thing like this:
Code:
|System1 |System2 |
|---------------------------------------|
|#Errors |State |#Errors |State |
--------------------------------------------------|
Archiver1 | 0 |Running | 1 |DOWN |
Archiver2 | 5 |Running | 0 |Running |
Archiver3 | 0 |DOWN | 8 |Running |
Problem: If I would use the if clauses structure from above this would become way too complex. Is there an elegant way around this I could use instead ?
Regards
Thomas