dd if=/dev/zero of=/swap bs=1024 count=2097152 mkswap /swap && chown root. /swap && chmod 0600 /swap && swapon /swap echo /swap swap swap defaults 0 0 >> /etc/fstab echo vm.swappiness = 0 >> /etc/sysctl.conf && sysctl -p
apt-get install -y nagios3 nagios-nrpe-plugin usermod -a -G nagios www-data chmod -R g+x /var/lib/nagios3/ sed -i 's/check_external_commands=0/check_external_commands=1/g' /etc/nagios3/nagios.cfg
htpasswd -c /etc/nagios3/htpasswd.users nagiosadmin service nagios3 restart && service apache2 restart
apt-get install -y nagios-plugins nagios-nrpe-server
log_facility=daemon pid_file=/var/run/nagios/nrpe.pid server_port=5666 nrpe_user=nagios nrpe_group=nagios allowed_hosts=198.211.117.129 dont_blame_nrpe=1 debug=0 command_timeout=60 connection_timeout=300 include=/etc/nagios/nrpe_local.cfg include_dir=/etc/nagios/nrpe.d/ command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10 command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20 command[check_hda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/vda command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 150 -c 200
iptables -N NRPE iptables -I INPUT -s 0/0 -p tcp --dport 5666 -j NRPE iptables -I NRPE -s 198.211.117.129 -j ACCEPT iptables -A NRPE -s 0/0 -j DROP /sbin/iptables-save
service nagios-nrpe-server restart
define host {
use generic-host
host_name cloudads.tk
alias cloudads.tk
address 198.211.117.101
}
define service {
use generic-service
host_name cloudads.tk
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
define service {
use generic-service
host_name cloudads.tk
service_description SSH
check_command check_ssh
notifications_enabled 0
}
define service {
use generic-service
host_name cloudads.tk
service_description Current Load
check_command check_load!5.0!4.0!3.0!10.0!6.0!4.0
}service nagios3 restart
Article ID: 276
Created On: Sat, Jan 4, 2014 at 4:44 AM
Last Updated On: Tue, Sep 23, 2025 at 11:03 PM
Authored by: ASPHostServer Administrator [[email protected]]
Online URL: http://faq.asphosthelpdesk.com/article.php?id=276