nagios-監控端的localhost.cfg配置
[root@mi3 ~]# cd /usr/local/nagios/etc/objects
[root@mi3 objects]# ls
commands.cfg contacts.cfg hosts localhost.cfg printer.cfg switch.cfg templates.cfg timeperiods.cfg windows.cfg
[root@mi3 objects]# cat localhost.cfg
###############################################################################
# LOCALHOST.CFG - SAMPLE OBJECT CONFIG FILE FOR MONITORING THIS MACHINE
#
#
# NOTE: This config file is intended to serve as an *extremely* simple
# example of how you can create configuration entries to monitor
# the local (Linux) machine.
#
###############################################################################
###############################################################################
###############################################################################
#
# HOST DEFINITION
#
###############################################################################
###############################################################################
# Define a host for the local machine
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
}
###############################################################################
###############################################################################
#
# HOST GROUP DEFINITION
#
###############################################################################
###############################################################################
# Define an optional hostgroup for Linux machines
define hostgroup{
hostgroup_name linux-servers ; The name of the hostgroup
alias Linux Servers ; Long name of the group
members localhost ; Comma separated list of hosts that belong to this group
}
###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
###############################################################################
# Define a service to "ping" the local machine
define service{
use local-service ; Name of service template to use
host_name localhost
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
# Define a service to check the disk space of the root partition
# on the local machine. Warning if < 20% free, critical if
# < 10% free space on partition.
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Root Partition
check_command check_local_disk!20%!10%!/
}
# Define a service to check the number of currently logged in
# users on the local machine. Warning if > 20 users, critical
# if > 50 users.
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Current Users
check_command check_local_users!20!50
}
# Define a service to check the number of currently running procs
# on the local machine. Warning if > 250 processes, critical if
# > 400 users.
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Total Processes
check_command check_local_procs!700!800!RSZDT
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description zombie Processes
check_command check_local_procs!5!10!Z
}
# Define a service to check the load on the local machine.
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Current Load
check_command check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
}
# Define a service to check the swap usage the local machine.
# Critical if less than 10% of swap is free, warning if less than 20% is free
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Swap Usage
check_command check_local_swap!20!10
}
# Define a service to check SSH on the local machine.
# Disable notifications for this service by default, as not all users may have SSH enabled.
define service{
use local-service ; Name of service template to use
host_name localhost
service_description SSH
check_command check_ssh
notifications_enabled 0
}
[root@mi3 objects]# ls
commands.cfg contacts.cfg hosts localhost.cfg printer.cfg switch.cfg templates.cfg timeperiods.cfg windows.cfg
[root@mi3 objects]# cat localhost.cfg
###############################################################################
# LOCALHOST.CFG - SAMPLE OBJECT CONFIG FILE FOR MONITORING THIS MACHINE
#
#
# NOTE: This config file is intended to serve as an *extremely* simple
# example of how you can create configuration entries to monitor
# the local (Linux) machine.
#
###############################################################################
###############################################################################
###############################################################################
#
# HOST DEFINITION
#
###############################################################################
###############################################################################
# Define a host for the local machine
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
}
###############################################################################
###############################################################################
#
# HOST GROUP DEFINITION
#
###############################################################################
###############################################################################
# Define an optional hostgroup for Linux machines
define hostgroup{
hostgroup_name linux-servers ; The name of the hostgroup
alias Linux Servers ; Long name of the group
members localhost ; Comma separated list of hosts that belong to this group
}
###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
###############################################################################
# Define a service to "ping" the local machine
define service{
use local-service ; Name of service template to use
host_name localhost
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
# Define a service to check the disk space of the root partition
# on the local machine. Warning if < 20% free, critical if
# < 10% free space on partition.
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Root Partition
check_command check_local_disk!20%!10%!/
}
# Define a service to check the number of currently logged in
# users on the local machine. Warning if > 20 users, critical
# if > 50 users.
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Current Users
check_command check_local_users!20!50
}
# Define a service to check the number of currently running procs
# on the local machine. Warning if > 250 processes, critical if
# > 400 users.
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Total Processes
check_command check_local_procs!700!800!RSZDT
}
define service{
use local-service ; Name of service template to use
host_name localhost
service_description zombie Processes
check_command check_local_procs!5!10!Z
}
# Define a service to check the load on the local machine.
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Current Load
check_command check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
}
# Define a service to check the swap usage the local machine.
# Critical if less than 10% of swap is free, warning if less than 20% is free
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Swap Usage
check_command check_local_swap!20!10
}
# Define a service to check SSH on the local machine.
# Disable notifications for this service by default, as not all users may have SSH enabled.
define service{
use local-service ; Name of service template to use
host_name localhost
service_description SSH
check_command check_ssh
notifications_enabled 0
}
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29819001/viewspace-1321550/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- nagios-被監控端的mi1.cfg配置iOS
- nagios的配置(監控端和被監控端)iOS
- nagios-新增記憶體監控iOS記憶體
- nagios-新增oracle資料庫監控iOSOracle資料庫
- nagios-建立記憶體監控指令碼iOS記憶體指令碼
- 監控寶SQL Server效能監控的功能和配置SQLServer
- springcloud 微服務配置監控端點 hystrix.streamSpringGCCloud微服務
- activeMQ JMS監控配置MQ
- Munin監控的安裝與配置
- junkman 遠端堆疊監控
- tomcat8.5服務開啟zabbix遠端監控配置修改Tomcat
- CentOS 配置OOM監控報警CentOSOOM
- redis sentinel 叢集監控 配置Redis
- 遠端影片監控實現的條件
- 監控database上的客戶端ip地址Database客戶端
- 運維監控丨16條常用的Kafka看板監控配置與告警規則運維Kafka
- 影片監控遠端傳輸方案
- 遠端監控Springboot JVMSpring BootJVM
- zabbix監控客戶端安裝客戶端
- Nagios for Aix監控客戶端iOSAI客戶端
- zabbix監控系統的安裝與配置
- 端到端網路全鏈路監控方案
- Centos效能監控工具——netdata配置CentOS
- 配置CACTI監控MySQL資料庫狀態(5)增加MySQL監控模板MySql資料庫
- linux遠端監控軟體nomachine的使用LinuxMac
- Java服務端監控:Prometheus與Grafana的整合Java服務端PrometheusGrafana
- 筆記:MMM監控端啟動流程筆記
- 分散式監控系統ganglia的詳細配置分散式
- MySQL 5.5半同步複製的配置與監控MySql
- 配置GG監控庫:192.168.9.144
- mrtg監控網路流量簡單配置
- 【SQL監控】SQL完全監控的指令碼SQL指令碼
- KAFKA監控一條龍:史上最強Kafka看板+監控配置與告警規則Kafka
- Linux下常用監控cacti的安裝和配置Linux
- APM效能監控軟體的監控型別服務及監控流程型別
- 使用Metrics方法級遠端監控Java程式Java
- rtop – 通過SSH監控遠端主機
- Splunk新增LINUX客戶端新增監控Linux客戶端