Difference between revisions of "Nagios"

From Wasya Wiki
Jump to: navigation, search
Line 1: Line 1:
<pre>
+
== Directory Structure Client ==
 +
/run/nagios
 +
/usr/lib/nagios/plugins <-
 +
/var/chef/backup/etc/nagios
 +
/var/chef/cache/cookbooks/nagios
 +
/var/lib/nagios
 +
/etc/nagios
  
-=----- nagios dirs on client
+
== Directory Structure Server ==
/run/nagios
+
/run/nagios
/usr/lib/nagios/plugins <-  
+
/usr/share/nagios/htdocs
/var/chef/backup/etc/nagios
+
/usr/lib/nagios/plugins <-
/var/chef/cache/cookbooks/nagios
+
/var/chef/backup/etc/nagios
/var/lib/nagios
+
/var/chef/cache/cookbooks/nagios
/etc/nagios
+
/var/lib/nagios <- empty
 +
/etc/nagios
 +
/run/nagios3
 +
/usr/sbin/nagios3 <- file
 +
/usr/share/doc/nagios3
 +
/ usr/share/nagios3
 +
/usr/share/lintian/overrides/nagios3
 +
/usr/lib/apache2/conf/enabled_by_maint/nagios3
 +
/usr/lib/cgi-bin/nagios3
 +
/ usr/lib/nagios3/p1.pl
 +
/var/log/nagios3
 +
/var/cache/nagios3
 +
/var/lib/nagios3 <- nothing there
 +
/etc/default/nagios3
 +
/etc/init.d/nagios3
 +
/etc/nagios3
  
-=----- nagios dirs on server
+
== Nagios Config ==
/run/nagios
+
* make sure IPs are allowed for communicatin
/usr/share/nagios/htdocs
+
* make sure ports are allowed for communication
/usr/lib/nagios/plugins <-
+
* client: put the custom plugin in /usr/lib/nagios/plugins/echo_ok3
/var/chef/backup/etc/nagios
+
* client: in /etc/nagios/nrpe.cfg:
/var/chef/cache/cookbooks/nagios
+
/var/lib/nagios <- empty
+
/etc/nagios
+
/run/nagios3
+
/usr/sbin/nagios3 <- file
+
/usr/share/doc/nagios3
+
/usr/share/nagios3
+
/usr/share/lintian/overrides/nagios3
+
/usr/lib/apache2/conf/enabled_by_maint/nagios3
+
/usr/lib/cgi-bin/nagios3
+
/usr/lib/nagios3/p1.pl
+
/var/log/nagios3
+
/var/cache/nagios3
+
/var/lib/nagios3 <- nothing there
+
/etc/default/nagios3
+
/etc/init.d/nagios3
+
/etc/nagios3
+
 
+
/usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
+
 
+
-=----- nagios config
+
- make sure IPs are allowed for communicatin
+
- make sure ports are allowed for communication
+
- client: put the custom plugin in /usr/lib/nagios/plugins/echo_ok3
+
- client: in /etc/nagios/nrpe.cfg:
+
 
   command[echo_ok3]=/usr/lib/nagios/plugins/echo_ok3
 
   command[echo_ok3]=/usr/lib/nagios/plugins/echo_ok3
- client: restart service
+
* client: restart service
 
   /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
 
   /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
- server:  
+
* server:  
 
  define command {
 
  define command {
 
   command_name echo-ok3
 
   command_name echo-ok3
Line 53: Line 49:
 
   use default-service
 
   use default-service
 
  }
 
  }
</pre>
 
  
 
= Nagios Utils =
 
= Nagios Utils =

Revision as of 18:31, 18 May 2017

Directory Structure Client

/run/nagios
/usr/lib/nagios/plugins 	<- 
/var/chef/backup/etc/nagios
/var/chef/cache/cookbooks/nagios
/var/lib/nagios
/etc/nagios

Directory Structure Server

/run/nagios
/usr/share/nagios/htdocs
/usr/lib/nagios/plugins		<-
/var/chef/backup/etc/nagios
/var/chef/cache/cookbooks/nagios
/var/lib/nagios	<- empty
/etc/nagios
/run/nagios3
/usr/sbin/nagios3	<- file
/usr/share/doc/nagios3
/ usr/share/nagios3
/usr/share/lintian/overrides/nagios3
/usr/lib/apache2/conf/enabled_by_maint/nagios3
/usr/lib/cgi-bin/nagios3
/ usr/lib/nagios3/p1.pl
/var/log/nagios3
/var/cache/nagios3
/var/lib/nagios3	<- nothing there
/etc/default/nagios3
/etc/init.d/nagios3
/etc/nagios3

Nagios Config

  • make sure IPs are allowed for communicatin
  • make sure ports are allowed for communication
  • client: put the custom plugin in /usr/lib/nagios/plugins/echo_ok3
  • client: in /etc/nagios/nrpe.cfg:
 command[echo_ok3]=/usr/lib/nagios/plugins/echo_ok3
  • client: restart service
 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
  • server:
define command {
  command_name echo-ok3
  command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c echo_ok3
}
define service {
  service_description echo-ok3
  hostgroup_name microsites3_api
  check_command echo-ok3
  use default-service
}

Nagios Utils

Setup Client

apt-get install -y nagios-plugins nagios-nrpe-server

Change password

htpasswd -c -b  /etc/nagios/htpasswd.users nagiosadmin admin

Nagios Custom Plugin

CHECK_NRPE: Error – Could not complete SSL handshake

From: https://geekpeek.net/could-not-complete-ssl-handshake/