A
alfonsobaldaserra
hello,
i'm trying to develop a nagios plugin to monitor oracle rac services.
the command i'm using is crs_stat and i get the output as follows
NAME=ora.footest.footest1.inst
TYPE=application
TARGET=ONLINE
STATE=ONLINE on srv03
[snip]
NAME=ora.srv04.ASM2.asm
TYPE=application
TARGET=ONLINE
STATE=ONLINE on srv04
i need to monitor only specific services so we can pass the service
name as argument and check it's output.
the problem is i cannot relate NAME with STATE to check it's current
state, for example, if i do
$ crs_stat | grep -Ev '^TYPE|^TARGET' | sed -e 's/^NAME=//g' -e 's/
^STATE=//g' | sed -e 's/^ONLINE on //g'
ora.footest.footest1.inst
srv03
[snip]
ora.srv04.ASM2.asm
srv04
so if i want to monitor ora.srv04.ASM2.asm i could do
$ crs_stat | grep -Ev '^TYPE|^TARGET' | sed -e 's/^NAME=//g' -e 's/
^STATE=//g' | sed -e 's/^ONLINE on //g' | grep ora.srv04.ASM2.asm
and get only
ora.srv04.ASM2.asm
but could not figure out the state.
is that possible?
is there a better way to do that?
thanks
i'm trying to develop a nagios plugin to monitor oracle rac services.
the command i'm using is crs_stat and i get the output as follows
NAME=ora.footest.footest1.inst
TYPE=application
TARGET=ONLINE
STATE=ONLINE on srv03
[snip]
NAME=ora.srv04.ASM2.asm
TYPE=application
TARGET=ONLINE
STATE=ONLINE on srv04
i need to monitor only specific services so we can pass the service
name as argument and check it's output.
the problem is i cannot relate NAME with STATE to check it's current
state, for example, if i do
$ crs_stat | grep -Ev '^TYPE|^TARGET' | sed -e 's/^NAME=//g' -e 's/
^STATE=//g' | sed -e 's/^ONLINE on //g'
ora.footest.footest1.inst
srv03
[snip]
ora.srv04.ASM2.asm
srv04
so if i want to monitor ora.srv04.ASM2.asm i could do
$ crs_stat | grep -Ev '^TYPE|^TARGET' | sed -e 's/^NAME=//g' -e 's/
^STATE=//g' | sed -e 's/^ONLINE on //g' | grep ora.srv04.ASM2.asm
and get only
ora.srv04.ASM2.asm
but could not figure out the state.
is that possible?
is there a better way to do that?
thanks