{{tag>icinga nagios monitoring}} ====== New icinga host setup - linux ====== ===== Prepare icinga client ===== adduser --gecos nagios --disabled-password --disabled-login nagios On RedHat/CentOS: adduser nagios ===== Install plugins ===== aptitude install nagios-plugins OR aptitude install nagios-plugins-basic nagios-plugins-standard aptitude install libnagios-plugin-perl (stretch: apt install libmonitoring-plugin-perl) On RedHat/CentOS: yum install nagios-plugins su - nagios mkdir -m 700 .ssh Add nagios ssh key: vi .ssh/authorized_keys add key... chmod 600 .ssh/authorized_keys Connect from icinga server to client before adding checks! su - nagios ssh nagios@ ===== Checks ===== ==== check_apt ==== add this in /etc/apt/apt.conf.d/02periodic: // Control parameters for cron jobs by /etc/cron.daily/apt // // Do "apt-get update" automatically every n-days (0=disable) APT::Periodic::Update-Package-Lists "1"; ==== check_iostat ==== apt install sysstat ==== check_mem ==== aptitude install libnagios-plugin-perl On Debian Stretch: apt install libmonitoring-plugin-perl CentOS: yum install perl-Nagios-Plugin On Stretch change instances of "Nagios::Plugin" to "Monitoring::Plugin" in check_mem.pl script ==== check_if_traffic ==== apt install snmpd Uncomment in /etc/snmp/snmpd.conf. On wheezy copy check_snmp_int.pl from some other server to /usr/lib/nagios/plugins/ # Full access from the local host rocommunity public localhost service snmpd restart On Jessie and Stretch replace my $descr_table = '1.3.6.1.2.1.2.2.1.2'; with my $descr_table = '1.3.6.1.2.1.31.1.1.1.1'; ==== check_yum.py ==== https://raw.githubusercontent.com/HariSekhon/nagios-plugins/master/check_yum.py adduser nagios yum install yum-security yum install nagios-plugins su - nagios mkdir -m 700 .ssh ==== check_raid.pl megacli ==== apt-get install sudo If error: //Remote command execution failed:// start check_raid.pl script, it will create the file: /home/nagios/bin/check_raid.pl -S https://github.com/glensc/nagios-plugin-check_raid#supported-raids then this is not needed: Remote command execution failed: sudo: no tty present and no askpass program specified Put this in /etc/sudoers file (use visudo command): #idev nagios User_Alias APTUSER = nagios Runas_Alias SUUSER = root Cmnd_Alias APTUSERCMD = /home/nagios/bin/check_raid.pl, /home/nagios/bin/apt_wrapper, /home/nagios/bin/checkForDeletedFiles.sh, /home/nagios/bin/check_unix_open_fds.pl, /usr/lib/nagios/plugins/check_ipmi_sensor, /usr/lib/nagios/plugins/check_raid APTUSER ALL= NOPASSWD: APTUSERCMD ==== check_mongodb ==== Download check_mongodb.py from https://github.com/mzupan/nagios-plugin-mongodb. Put the script in /home/nagios/bin and install requirements apt install python-minimal python-pip pip install pymongo ====== Tested on ====== * ====== See also ====== * [[New host setup - windows]] * [[Icinga troubleshooting]] ====== References ======