「シェル学習」Zabbixでgeramanのモニタリングを設定するshellプログラム

shellコード下記:
#!/bin/sh
zabbix_server=xxx.xxx.xxx.xxx
my_zabbix_hostname=${Host名_Registered_In_Zabbix}

queue_name=${Queue名前}
interval_seconds=5

while :
do
gearadmin –status | awk '
$1=="'$queue_name'"{
print “'$my_zabbix_hostname'", “gearman.total_job_count['$queue_name’]", $2
print “'$my_zabbix_hostname'", “gearman.running_job_count['$queue_name’]", $3
print “'$my_zabbix_hostname'", “gearman.worker_process_count['$queue_name’]", $4
}’ | zabbix_sender -z $zabbix_server -s $my_zabbix_hostname -i –
sleep $interval_seconds
done

shellscript

Posted by arkgame