ワニスのパフォーマンスを監視するために、LogicMonitorコレクターはSNMP拡張機能を使用して、サーバー上で「varnishstat-1」コマンドを実行するスクリプトをトリガーします。
データ収集を有効にするには、各Varnishサーバーで次の手順を実行してください。
1. / usr / local / binにスクリプト「varnishparse」を作成します。
#!/ bin / bash / usr / bin / varnishstat -1 -f $ 1 | awk '{print $ 2}'
2.次のすべてを/etc/snmp/snmpd.confファイルに入れます( 設定された SNMP):
extend varnish-client-req / usr / local / bin / varnishparse client_req extends varnish-client-conn / usr / local / bin / varnishparse client_conn extends varnish-cache-hits / usr / local / bin / varnishparse cache_hit extend varnish-cache- miss / usr / local / bin / varnishparse cache_miss extends varnish-cache-hitpass / usr / local / bin / varnishparse cache_hitpass extend varnish-backend-unused / usr / local / bin / varnishparse backend_unused extends varnish-backend-unhealthy / usr / local / bin / varnishparse backend_unhealthy extends varnish-backend-reuse / usr / local / bin / varnishparse backend_reuse extends varnish-backend-recycle / usr / local / bin / varnishparse backend_recycle extends varnish-backend-fail / usr / local / bin / varnishparse backend_fail extend varnish-backend-busy / usr / local / bin / varnishparse backend_busy extends varnish-backend-conn / usr / local / bin / varnishparse backend_conn extend varnish-s-sess / usr / local / bin / varnishparse s_sess extends varnish-s- req / usr / local / bin / varnishparse s_req extends varnish-s-pipe / usr / local / bin / varnishparse s _pipe extends varnish-s-fetch / usr / local / bin / varnishparse s_fetch extends varnish-s-pass / usr / local / bin / varnishparse s_pass extends varnish-s-hdrbytes / usr / local / bin / varnishparse s_hdrbytes extends varnish-s -bodybytes / usr / local / bin / varnishparse s_bodybytes extends varnish-n-object / usr / local / bin / varnishparse n_object extends varnish-n-wrk / usr / local / bin / varnishparse n_wrk extends varnish-n-wrk-max / usr / local / bin / varnishparse n_wrk_max extends varnish-n-wrk-overflow / usr / local / bin / varnishparse n_wrk_overflow extends varnish-n-wrk-drop / usr / local / bin / varnishparse n_wrk_drop extends varnish-n-lru-nuked / usr / local / bin / varnishparse n_lru_nuked extends varnish-n-expired / usr / local / bin / varnishparse n_expired extend varnish-n-wrk-queue / usr / local / bin / varnishparse n_wrk_queue extends varnish-n-wrk-failed / usr / local / bin / varnishparse n_wrk_failed extends varnish-n-wrk-create / usr / local / bin / varnishparse n_wrk_create
3. snmpdを再起動します(サービスsnmpdrestart)。
上記の手順を完了すると、Varnish Performanceデータソースが適切なホストに関連付けられ、監視が自動的に開始されます。