harumaki.net

インフラ屋の覚書や、ラーメン食べある記とか。

GNU/Linux infra nagios 運用

nagios​/plugin​/nagios exchange[メモ]

投稿日:2010年11月25日

Last Updated on 2021年7月4日 by かんりにん

 
[pukiwiki]

*nagiosプラグイン[nagios exchenge] [#b87d3de8]

nagiosのnagios-pluginパッケージに含まれていないアドオンで
必要と思われるものをピックアップ。
おもにnaigos exchangeからダウンロード。
記事が未記入のものは、そのうちに試すつもり…

**check_cpu.sh [#da146aff]
http://exchange.nagios.org/directory/Plugins/Operating-Systems/Linux/check_cpu-2Esh/details

-使用例
$ ./check_cpu.sh
OK – user: 0.50, nice: 0.50, sys: 4.34, iowait: 0.50, irq: 0.50, softirq: 0.50 idle: 96.65 | ‘user’=0.50 ‘nice’=0.50 ‘sys’=4.34 ‘softirq’=0.50 ‘iowait’=0.50 ‘irq’=0.50 ‘idle’=96.65

-command.cfg追加例
# 2010-11-24 exchange plugin
# ‘check_local_cpu’ command definition
define command{
command_name check_local_cpu
command_line $USER1$/check_cpu.sh -w $ARG1$ -c $ARG2$
}

-ホスト別サービス定義例(localhost.cfgなど)
# Define a service to check the cpu on the local machine.

define service{
use local-service ; Name of service template to use
host_name testhost
service_description Cpu Usage
check_command check_local_cpu!80!90
}

-nagiosgraphのmap追加例
# Service type: unix-cpu
# OK – user: 0.50, nice: 0.50, sys: 3.38, iowait: 0.50, irq: 0.50, softirq: 0.50 idle: 97.61′
# user=0.50 nice=0.50 sys=3.38 softirq=0.50 iowait=0.50 irq=0.50 idle=97.61
/output:user: ([.0-9]+), nice: ([.0-9]+), sys: ([.0-9]+), iowait: ([.0-9]+), irq: ([.0-9]+), softirq: ([.0-9]+) idle: ([.0-9]+)/
and push @s, [ ‘cpu’,
[ ‘user’, GAUGE, $1 ],
[ ‘nice’, GAUGE, $2 ],
[ ‘sys’, GAUGE, $3 ],
[ ‘softirq’, GAUGE, $4 ],
[ ‘iowait’, GAUGE, $5 ],
[ ‘irq’, GAUGE, $6 ],
[ ‘idle’, GAUGE, $7 ] ];

**check_mem.pl [#fcd737be]
http://exchange.nagios.org/directory/Plugins/Operating-Systems/Linux

-使用例
$ perl check_mem.pl -u -w 90 -c 95
CRITICAL – 95.5% (1001052 kB) used!||TOTAL=1048752KB;;;; USED=1001052KB;;;; FREE=47700KB;;;; CACHES=896432KB;;;
-command.cfg追加例
# ‘check_local_mem’ command definition
define command{
command_name check_local_mem
command_line $USER1$/check_mem.pl -u -w $ARG1$ -c $ARG2$
}

-ホスト別サービス定義例(localhost.cfgなど)
# Define a service to check the memory on the local machine.
define service{
use local-service ; Name of service template to use
host_name testhost
service_description Memory Usage
check_command check_local_mem!80!95
}

**check_apachestatus [#w7a23f47]
http://exchange.nagios.org/directory/Plugins/Web-Servers/Apache/check_apachestatus/details

**check_postfix [#i74b1958]
http://exchange.nagios.org/directory/Plugins/Email-and-Groupware/Postfix/check_postfix/details

**check_postfix_queue [#abe906d5]

**check_mysql_count [#ce14a179]
http://exchange.nagios.org/directory/Plugins/Databases/MySQL/check_mysql_count/details

**check_mysql [#se155f38]
http://exchange.nagios.org/directory/Plugins/Databases/MySQL/check_mysql/details

**check_mysqld [#dfd92699]
http://exchange.nagios.org/directory/Plugins/Databases/MySQL/check_mysqld/details

**check_mysql_health [#dd6d4d77]
http://exchange.nagios.org/directory/Plugins/Databases/MySQL/check_mysql_health/details

**check_mysql_status [#oa9c55f4]
http://exchange.nagios.org/directory/Plugins/Databases/MySQL/check_mysql_status/details

**check_url [#kb0810c8]
http://exchange.nagios.org/directory/Plugins/Websites%2C-Forms-and-Transactions/check_url/details

-使用例
$ perl check_url.pl http://www.yahoo.co.jp/
OK: 200 OK

**check_http_header [#idc19d36]
http://exchange.nagios.org/directory/Plugins/Websites%2C-Forms-and-Transactions/check_http_header/details

**check_ssl_cert [#i64a64c9]
http://exchange.nagios.org/directory/Plugins/Network-Protocols/HTTP/check_ssl_cert/details

[/pukiwiki]
 

 

-GNU/Linux, infra, nagios, 運用
-

執筆者:


comment

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

CAPTCHA


関連記事

no image

haproxyを試す 5.コマンドライン操作

  先日のステータス出力を検証した流れで、haproxyのコマンドライン操作について試したことを抜粋。 参考:またまたお世話になっております! Ver1.5 マニュアル 9.2 Unix Socket …

nagios core​/1.インストール

  [pukiwiki] ものすっごい久しぶり、5年ぶりくらいに環境をセットアップしたので一応メモ。 インストールおよび初期設定までの作業ログ。 コンフィグの書式とかはなんとなく覚えてるけど、どれが何 …

no image

カーネル負荷テストツール(LTP)

[pukiwiki] *カーネル負荷テストツール(LTP) IBM、SGI、OSDLなどが共同で運営している[[Linux Test Project(ltp):http://ltp.sourcefor …

no image

サーバー構築をする時のミクロな悩み:環境変数

※RedHat、CentOSでのbash環境での話です。 サーバー構築をする時、定石として一番悩ましいのが”環境変数をどこに明示するか?”なのですが いろいろ悩んだ末の結論とし …

no image

[NTP]StepモードとSlewモード

DBサーバの時間同期の修正にあたって、どのくらいゆっくり修正できるのか調べたら、もともと”Slewモード”という”ゆっくり修正オプション(?)”があった …