1
18.1 Legacy Series / Re: Icinga2 Monitoring Agent
« on: December 10, 2018, 06:43:53 pm »
you already can install icinga2 via FreeBSD ports. the configuration will be done per cli only until now but it works very well
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
...
const ZoneName = "<MY-SATELLITE-ZONE>"
...
/*
* Generated by Icinga 2 node setup commands
* on 2017-11-17 18:56:55 +0100
*/
object Endpoint "<MASTER-FQDN>" {
host = "<MASTER-IP>"
port = "5665"
}
object Zone "master" {
endpoints = [ "<MASTER-FQDN>" ]
}
object Zone "global-templates" {
global = true
}
object Endpoint NodeName {
}
object Zone ZoneName {
endpoints = [ NodeName ]
parent = "master"
}
object Endpoint "<AGENT-NODE-FQDN>" {
host = "<AGENT-NODE-IP>"
log_duration = 0s
}
object Zone "<AGENT-NODE-FQDN>" {
parent = "<MY-SATELLITE-ZONE>"
endpoints = [ "<AGENT-NODE-FQDN>" ]
}
...
#include_recursive "conf.d"
...
/**
* This file defines global constants which can be used in
* the other configuration files.
*/
/* The directory which contains the plugins from the Monitoring Plugins project. */
const PluginDir = "/usr/lib/nagios/plugins"
/* The directory which contains the Manubulon plugins.
* Check the documentation, chapter "SNMP Manubulon Plugin Check Commands", for details.
*/
const ManubulonPluginDir = "/usr/lib/nagios/plugins"
/* The directory which you use to store additional plugins which ITL provides user contributed command definitions for.
* Check the documentation, chapter "Plugins Contribution", for details.
*/
const PluginContribDir = "/usr/lib/nagios/plugins"
/* Our local instance name. By default this is the server's hostname as returned by `hostname --fqdn`.
* This should be the common name from the API certificate.
*/
const NodeName = "<AGENT-NODE-FQDN>"
/* Our local zone name. */
const ZoneName = "<AGENT-NODE-FQDN>"
/* Secret key for remote node tickets */
const TicketSalt = ""
/*
* Generated by Icinga 2 node setup commands
* on 2017-11-17 18:56:55 +0100
*/
object Endpoint "<MASTER-FQDN>" {
host = "<MASTER-IP>"
port = "5665"
}
object Zone "master" {
endpoints = [ "<MASTER-FQDN>" ]
}
object Zone "global-templates" {
global = true
}
object Endpoint NodeName {
}
object Zone ZoneName {
endpoints = [ NodeName ]
parent = "master"
}
/**
* Icinga 2 configuration file
* - this is where you define settings for the Icinga application including
* which hosts/services to check.
*
* For an overview of all available configuration options please refer
* to the documentation that is distributed as part of Icinga 2.
*/
/**
* The constants.conf defines global constants.
*/
include "constants.conf"
/**
* The zones.conf defines zones for a cluster setup.
* Not required for single instance setups.
*/
include "zones.conf"
/**
* The Icinga Template Library (ITL) provides a number of useful templates
* and command definitions.
* Common monitoring plugin command definitions are included separately.
*/
include <itl>
include <plugins>
include <plugins-contrib>
include <manubulon>
/**
* This includes the Icinga 2 Windows plugins. These command definitions
* are required on a master node when a client is used as command endpoint.
*/
include <windows-plugins>
/**
* This includes the NSClient++ check commands. These command definitions
* are required on a master node when a client is used as command endpoint.
*/
include <nscp>
/**
* The features-available directory contains a number of configuration
* files for features which can be enabled and disabled using the
* icinga2 feature enable / icinga2 feature disable CLI commands.
* These commands work by creating and removing symbolic links in
* the features-enabled directory.
*/
include "features-enabled/*.conf"
/**
* Although in theory you could define all your objects in this file
* the preferred way is to create separate directories and files in the conf.d
* directory. Each of these files must have the file extension ".conf".
*/
include_recursive "conf.d"
WAN TCP * * WAN address 443 (HTTPS) 127.0.0.1 443 (HTTPS)
IPv4 TCP * * 127.0.0.1 443 (HTTPS) * NAT
sockstat | grep haproxy
www haproxy 17125 4 dgram -> /var/run/log
www haproxy 17125 5 stream /var/run/configd.socket
www haproxy 17125 6 stream /var/run/configd.socket
www haproxy 17125 9 stream /var/run/haproxy.socket.16847.tmp
www haproxy 17125 10 tcp4 127.0.0.1:80 *:*
www haproxy 17125 11 dgram (not connected)
www haproxy 17125 12 tcp4 127.0.0.1:443 *:*
root syslogd 22806 6 dgram /var/haproxy/var/run/log
haproxy[17125]: 80.187.xxx.xxx:6768 [06/May/2017:17:48:51.735] nc_ssl nc_ssl/<NOSRV> -1/-1/-1/-1/14 400 187 - - PR-- 0/0/0/0/0 0/0 "<BADREQ>"
cat /usr/local/etc/haproxy.conf
#
# Automatically generated configuration.
# Do not edit this file manually.
global
# NOTE: Could be a security issue, but required for some feature.
uid 80
gid 80
chroot /var/haproxy
daemon
stats socket /var/run/haproxy.socket level admin
nbproc 1
tune.ssl.default-dh-param 1024
spread-checks 0
tune.chksize 16384
tune.bufsize 16384
tune.lua.maxmem 0
log /var/run/log local0 info
defaults
log global
option redispatch -1
timeout client 30s
timeout connect 30s
timeout server 30s
retries 3
# Frontend: nc ()
frontend nc
bind 127.0.0.1:80 name 127.0.0.1:80
mode http
option http-keep-alive
default_backend nc
# tuning options
timeout client 30s
# logging options
option httplog
# ACL: nc
acl acl_590db1ef08fa94.67054859 hdr(host) -i www.example.com
# ACTION: nc
use_backend nc if acl_590db1ef08fa94.67054859
# Frontend: nc_ssl ()
frontend nc_ssl
bind 127.0.0.1:443 name 127.0.0.1:443
mode http
option http-keep-alive
default_backend nc_ssl
# tuning options
timeout client 30s
# logging options
option httplog
# ACL: nc_ssl
acl acl_590db1b706db30.36331514 req.ssl_sni -i www.example.com
# ACTION: nc_ssl
use_backend nc_ssl if acl_590db1b706db30.36331514
# Backend: acme_challenge_backend (Added by Let's Encrypt plugin)
backend acme_challenge_backend
# health checking is DISABLED
mode http
balance source
# stickiness
stick-table type ip size 50k expire 30m
stick on src
# tuning options
timeout connect 30s
timeout server 30s
server acme_challenge_host 127.0.0.1:43580
# Backend: nc_ssl ()
backend nc_ssl
# health checking is DISABLED
mode http
balance source
# stickiness
stick-table type ip size 50k expire 30m
stick on src
# tuning options
timeout connect 30s
timeout server 30s
server nc_ssl 10.254.80.215:443 ssl verify none
# Backend: nc ()
backend nc
# health checking is DISABLED
mode http
balance source
# stickiness
stick-table type ip size 50k expire 30m
stick on src
# tuning options
timeout connect 30s
timeout server 30s
server nc 10.254.80.215:80
# statistics are DISABLED