I am trying to monitor drive space for oracle asm volumes. I have created a script that writes a file to /tmp and is executed through cron to write the volume names and sizes. As long as only one line comes back, the UserParameter works fine, otherwise I get the Unsupported message in zabbix. I changed the grep pattern to look at the beginning of the line which works fine on the command line, but breaks all of the queries in UserParameter (Unsupported).
Here are the two entries in the conf file.
-----
UserParameter=bi.asm[*],grep $2 $1 |sed 's/.*[\ \t]//'
UserParameter=bi.asm2[*],grep ^$2 $1 |sed 's/.*[\ \t]//'
-----
$2 is the Volume name
$1 is the file to search
- bi.asm works until you get two of the same
- bi.asm2 breaks always (apostrophies do not appear to help)
Here is the content of the text file
-----
>cat /tmp/asmusage.txt
ARCH 0
DATA 71
INDEX 49
REDO_LOGS 84
TEMP 42
ZFRC_DATA 33
ZFRC_INDEX 72
-----
Here is the "item" in zabbix
-----
bi.asm[/tmp/asmusage.txt, DATA]
-----
Any suggestions to get a consistent grep to work?
Here are the two entries in the conf file.
-----
UserParameter=bi.asm[*],grep $2 $1 |sed 's/.*[\ \t]//'
UserParameter=bi.asm2[*],grep ^$2 $1 |sed 's/.*[\ \t]//'
-----
$2 is the Volume name
$1 is the file to search
- bi.asm works until you get two of the same
- bi.asm2 breaks always (apostrophies do not appear to help)
Here is the content of the text file
-----
>cat /tmp/asmusage.txt
ARCH 0
DATA 71
INDEX 49
REDO_LOGS 84
TEMP 42
ZFRC_DATA 33
ZFRC_INDEX 72
-----
Here is the "item" in zabbix
-----
bi.asm[/tmp/asmusage.txt, DATA]
-----
Any suggestions to get a consistent grep to work?
Comment