code.htm

% vi localhost.cfg
# 監視時間の定義、定義した設定を 24x7 と名付ける
define timeperiod{
       timeperiod_name 24x7
       alias           24 Hours A Day, 7 Days A Week
       sunday          00:00-24:00
       monday          00:00-24:00
       tuesday         00:00-24:00
       wednesday       00:00-24:00
       thursday        00:00-24:00
       friday          00:00-24:00
       saturday        00:00-24:00
       }
# コンタクト(連絡手段)の設定
define contact{
       contact_name                    nagios-admin
       alias                           Nagios Admin
       service_notification_period     24x7
       host_notification_period        24x7
       service_notification_options    w,u,c,r
       host_notification_options       d,r
       service_notification_commands   notify-by-email
       host_notification_commands      host-notify-by-email
       email                           alert@example.com
       }
define contactgroup{
       contactgroup_name       admins
       alias                   Nagios Administrators
       members                 nagios-admin
       }
# ホスト種類の設定
define host{
       name                            linux-server    ; The name of this host template
       use                             generic-host    ; This template inherits other values from the generic-host template
       check_period                    24x7            ; By default, Linux hosts are checked round the clock
       max_check_attempts              10              ; Check each Linux host 10 times (max)
       check_command                   check-host-alive ; Default command to check Linux hosts
       notification_period             workhours       ; Linux admins hate to be woken up, so we only notify during the day
                                                       ; Note that the notification_period variable is being overridden from
                                                       ; the value that is inherited from the generic-host template!
       notification_interval           120             ; Resend notification every 2 hours
       notification_options            d,u,r           ; Only send notifications for specific host states
       contact_groups                  admins          ; Notifications get sent to the admins by default
       register                        0               ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
       }
define host{
       use                     linux-server            ; Name of host template to use
                                                       ; This host definition will inherit all variables that are defined
                                                       ; in (or inherited by) the linux-server host template definition.
       host_name               localhost
       alias                   localhost
       address                 127.0.0.1
       }
# サービス(実際の監視対象とコマンドの関連付け)の設定
define service{
       name                            generic-service         ; The 'name' of this service template
       active_checks_enabled           1                       ; Active service checks are enabled
       passive_checks_enabled          1                       ; Passive service checks are enabled/accepted
       parallelize_check               1                       ; Active service checks should be parallelized (disabling this can lead to major performance problems)
       obsess_over_service             1                       ; We should obsess over this service (if necessary)
       check_freshness                 0                       ; Default is to NOT check service 'freshness'
       notifications_enabled           1                       ; Service notifications are enabled
       event_handler_enabled           1                       ; Service event handler is enabled
       flap_detection_enabled          1                       ; Flap detection is enabled
       failure_prediction_enabled      1                       ; Failure prediction is enabled
       process_perf_data               1                       ; Process performance data
       retain_status_information       1                       ; Retain status information across program restarts
       retain_nonstatus_information    1                       ; Retain non-status information across program restarts
       is_volatile                     0                       ; The service is not volatile
       register                        0                       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
       } 
define service{
       use                             local-service         ; Name of service template to use
       host_name                       localhost
       service_description             HTTP
       check_command                   check_http
       }

人気記事トップ10

人気記事ランキングをもっと見る

企画広告も役立つ情報バッチリ! Sponsored

「BOTCHAN」の顧客体験向上と社内経営分析の高度化をClickHouse Cloudが支援。性能を大幅に向上しながらDBコストの劇的な削減に向けて前進 12月2日 6:30 複雑化するIT基盤を束ね、ハイブリッド環境で"選ぶ自由"と"運用のしやすさ"を両立する 11月30日 6:35 現場に即応するオンプレミスの「推論基盤」が、AIモデルを業務の成果につなげる 11月26日 6:30 サーバやOSの保守期限、VMware環境の見直しといった節目に考える、Oracle AI Databaseの次期基盤。オンプレ継続・AWS・OCIそれぞれの特性と留意点を整理するWebセミナー 11月19日 16:00 AIエージェントの“見えないリスク”に備えてアイデンティティを「関係」で統制する 11月17日 6:25 AI生成コードをどう安全に使うか――決定論的検証とAutoFixで築く品質保証ワークフロー 11月16日 6:30 デジタル主権時代、データとモデルの持ち方は企業が主体的に定める 11月13日 6:25 ClickHouse Cloudが実現した広告運用SaaS「ATOM」のデータ基盤革新、パフォーマンスを向上しながら、運用負荷とコストを削減 11月11日 6:20 AIで開発が加速する時代、品質保証はどう変わる? Tricentisが示すAIエージェント活用の実像 11月9日 6:45 悪用までの猶予が「1分」に迫るフロンティアAI時代に開発と本番を貫く脆弱性管理が必要 10月29日 8:30