Nagios, SNMPTT, AWK
Posted: Tue Nov 15, 2011 5:05 am
Hi all,
I want to parse a text trap in order to send it to Nagios using SNMPTT.
I'm developing a AWK system using a configuration file like this:
Before the parsing the text, i'd like to modify the $0 variable in order to remove all spaces and all uppercase chars:
CC Error - Serrenti TV - 0h00500 --> ccerror-serrentitv-0h00500
The command must return only one word: W2M-D9.
How i can do?
Thanks,
Marco
I want to parse a text trap in order to send it to Nagios using SNMPTT.
I'm developing a AWK system using a configuration file like this:
Code: Select all
echo "CC Error - Serrenti TV - 0h00500" | awk -f file_configuration
file_configuration:
$0 ~ /ftv|reunion|mayotte|serrentitv|rad|libre64/ {print "W2M-D9"}CC Error - Serrenti TV - 0h00500 --> ccerror-serrentitv-0h00500
The command must return only one word: W2M-D9.
How i can do?
Thanks,
Marco