1. Log file generated by Script 650) this.width=650; "Src=" http://s4.51cto.com/wyfs02/M01/7A/E3/ Wkiom1bbj3or1mjzaaffkmbbdgk012.jpg "title=" aa.jpg "alt=" Wkiom1bbj3or1mjzaaffkmbbdgk012.jpg "/>
2. Add a custom Script
oracle_discovery.sh
The script takes out the tablespace name and makes the JSON formatted output (because the data type obtained by Zabbix's Autodiscover function is in JSON format)
#!/bin/bash Tablespace= ' Cat/home/patrol/tablespace.log |awk ' {print$2} ' |awk ' Nr>3{print} ' Count= ' echo ' $TABLESPACE ' |wc-l ' Index=0 Echo ' {' Data ': [' echo "$TABLESPACE" | while read line; Do Echo-n ' {"{#TABLENAME}": "' $LINE '"} ' index= ' expr $INDEX + 1 ' If [$INDEX-lt $COUNT]; Then Echo ', ' Fi Done |
oracle_check.sh
Use this script to get table space size, using tablespace size and tablespace usage
#!/bin/bash Eq_data= "$" Zbx_req_data_tab= "$" Source_data=/home/patrol/tablespace.log Case $ in MAXMB) grep-e "$ZBX _req_data_tab" $SOURCE _data |awk ' {print $5*1024*1024} ';; Used) grep-e "$ZBX _req_data_tab" $SOURCE _data |awk ' {print $6*1024*1024} ';; autopercent) grep-e "$ZBX _req_data_tab" $SOURCE _data |awk ' {print $7} ';; *) echo $ERROR _wrong_param; Exit 1;; Esac Exit 0 |
3. Script Empowerment
650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M01/7A/E4/wKiom1bBk1SAyxtvAADDR-epg4Y960.jpg "title=" D.jpg " alt= "Wkiom1bbk1sayxtvaaddr-epg4y960.jpg"/>
4. Adding Custom monitoring items
[Email protected] zabbix_agentd.d16:59:23]# more oracle.conf userparameter=ora.tab.discovery,/etc/zabbix/scripts/oracle_discovery.sh Userparameter=tablespace[*],/etc/zabbix/scripts/oracle_check.sh $ |
5. Restart Agent
/etc/init.d/zabbix-agent restart |
6. Add a Discovery Rule
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/7A/E3/wKioL1bBlaOgDQqyAAHFzBrFcn4336.jpg "title=" 111. JPG "alt=" wkiol1bblaogdqqyaahfzbrfcn4336.jpg "/>
7. Adding monitoring items
650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M01/7A/E4/wKiom1bBlYqzyOTPAAFpFs-3NYQ133.jpg "title=" 2222. JPG "alt=" wkiom1bblyqzyotpaafpfs-3nyq133.jpg "/>
8. The following data is displayed after configuration
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/7A/E4/wKiom1bBli_jl_PpAAPJn6FEX18932.jpg "title=" Qqqq.jpg "alt=" Wkiom1bbli_jl_ppaapjn6fex18932.jpg "/>
This article is from the IT Operations blog, so be sure to keep this source http://xujh1986.blog.51cto.com/5550987/1742171
Zabbix Monitoring database table space size