linux nagios 监控脚本,Nagios用Check-NRPE方式监控Linux主机

define host{

use linux-server ; Name of host template to use

host_name linuxserver

alias my linux server

address 192.168.0.102

}

###############################################################################

###############################################################################

#

# HOST GROUP DEFINITION

#

###############################################################################

###############################################################################

# Define an optional hostgroup for Linux machines

# hostgroup_name linux-servers ; The name of the hostgroup

# alias Linux Servers ; Long name of the group

# }

###############################################################################

###############################################################################

#

###############################################################################

###############################################################################

# Define a service to "ping" the local machine

define service{

host_name linuxserver

service_description users

check_command check_nrpe!check_users

# 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{

host_name linuxserver

service_description load

check_command check_nrpe!check_load

# 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{

host_name linuxserver

}

# 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{

host_name linuxserver

}

# Define a service to check the load on the local machine.

define service{

host_name linuxserver

service_description zombie

check_command check_nrpe!check_zombie_procs

}

# Define a service to check the swap usage the local machine.

define service{

host_name linuxserver

service_description total

check_command check_nrpe!check_total_procs

}

# Define a service to check SSH on the local machine.

# Disable notifications for this service by default, as not all users may have SSH enab

led.

# Define a service to check HTTP on the local machine.

# Disable notifications for this service by default, as not all users may have HTTP ena

bled.

define service{

use local-service ; Name of service templat

e to use

host_name linuxserver

service_description swap

check_command check_nrpe!check_swap

}

vim ../nagios.cfg

添加一行

cfg_file=/usr/local/nagios/etc/objects/linux-server.cfg

4.检查语法错误

nagios -v /usr/local/nagios/etc/nagios.cfg

service nagios restart

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值