Compare commits
No commits in common. "master" and "v0.5" have entirely different histories.
@ -1,41 +0,0 @@
|
|||||||
global
|
|
||||||
log /dev/log local0
|
|
||||||
log /dev/log local1 notice
|
|
||||||
chroot /var/lib/haproxy
|
|
||||||
stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
|
|
||||||
stats timeout 30s
|
|
||||||
user haproxy
|
|
||||||
group haproxy
|
|
||||||
daemon
|
|
||||||
|
|
||||||
# Default SSL material locations
|
|
||||||
ca-base /etc/ssl/certs
|
|
||||||
crt-base /etc/ssl/private
|
|
||||||
|
|
||||||
# See: https://ssl-config.mozilla.org/#server=haproxy&server-version=2.0.3&config=intermediate
|
|
||||||
ssl-default-bind-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
|
|
||||||
ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256
|
|
||||||
ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets
|
|
||||||
|
|
||||||
defaults
|
|
||||||
log global
|
|
||||||
mode http
|
|
||||||
option httplog
|
|
||||||
option dontlognull
|
|
||||||
timeout connect 5000
|
|
||||||
timeout client 50000
|
|
||||||
timeout server 50000
|
|
||||||
errorfile 400 /etc/haproxy/errors/400.http
|
|
||||||
errorfile 403 /etc/haproxy/errors/403.http
|
|
||||||
errorfile 408 /etc/haproxy/errors/408.http
|
|
||||||
errorfile 500 /etc/haproxy/errors/500.http
|
|
||||||
errorfile 502 /etc/haproxy/errors/502.http
|
|
||||||
errorfile 503 /etc/haproxy/errors/503.http
|
|
||||||
errorfile 504 /etc/haproxy/errors/504.http
|
|
||||||
listen httpProxy
|
|
||||||
bind 192.168.0.160:80
|
|
||||||
balance roundrobin
|
|
||||||
option httpclose
|
|
||||||
option httpchk HEAD / HTTP/1.0
|
|
||||||
server web1 172.16.0.11:80 check
|
|
||||||
server web2 172.16.0.12:80 check
|
|
@ -1,5 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
while [ true ]
|
|
||||||
do
|
|
||||||
curl -s http://192.168.0.160 -o /dev/null
|
|
||||||
done
|
|
@ -1,125 +0,0 @@
|
|||||||
# dhcpd.conf
|
|
||||||
#
|
|
||||||
# Sample configuration file for ISC dhcpd
|
|
||||||
#
|
|
||||||
|
|
||||||
# option definitions common to all supported networks...
|
|
||||||
option domain-name "example.org";
|
|
||||||
option domain-name-servers ns1.example.org, ns2.example.org;
|
|
||||||
|
|
||||||
default-lease-time 600;
|
|
||||||
max-lease-time 7200;
|
|
||||||
|
|
||||||
# The ddns-updates-style parameter controls whether or not the server will
|
|
||||||
# attempt to do a DNS update when a lease is confirmed. We default to the
|
|
||||||
# behavior of the version 2 packages ('none', since DHCP v2 didn't
|
|
||||||
# have support for DDNS.)
|
|
||||||
ddns-update-style none;
|
|
||||||
|
|
||||||
# If this DHCP server is the official DHCP server for the local
|
|
||||||
# network, the authoritative directive should be uncommented.
|
|
||||||
#authoritative;
|
|
||||||
|
|
||||||
# Use this to send dhcp log messages to a different log file (you also
|
|
||||||
# have to hack syslog.conf to complete the redirection).
|
|
||||||
#log-facility local7;
|
|
||||||
|
|
||||||
# No service will be given on this subnet, but declaring it helps the
|
|
||||||
# DHCP server to understand the network topology.
|
|
||||||
|
|
||||||
#subnet 10.152.187.0 netmask 255.255.255.0 {
|
|
||||||
#}
|
|
||||||
|
|
||||||
# This is a very basic subnet declaration.
|
|
||||||
|
|
||||||
#subnet 10.254.239.0 netmask 255.255.255.224 {
|
|
||||||
# range 10.254.239.10 10.254.239.20;
|
|
||||||
# option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
|
|
||||||
#}
|
|
||||||
|
|
||||||
# This declaration allows BOOTP clients to get dynamic addresses,
|
|
||||||
# which we don't really recommend.
|
|
||||||
|
|
||||||
#subnet 10.254.239.32 netmask 255.255.255.224 {
|
|
||||||
# range dynamic-bootp 10.254.239.40 10.254.239.60;
|
|
||||||
# option broadcast-address 10.254.239.31;
|
|
||||||
# option routers rtr-239-32-1.example.org;
|
|
||||||
#}
|
|
||||||
|
|
||||||
# A slightly different configuration for an internal subnet.
|
|
||||||
#subnet 10.5.5.0 netmask 255.255.255.224 {
|
|
||||||
# range 10.5.5.26 10.5.5.30;
|
|
||||||
# option domain-name-servers ns1.internal.example.org;
|
|
||||||
# option domain-name "internal.example.org";
|
|
||||||
# option routers 10.5.5.1;
|
|
||||||
# option broadcast-address 10.5.5.31;
|
|
||||||
# default-lease-time 600;
|
|
||||||
# max-lease-time 7200;
|
|
||||||
#}
|
|
||||||
|
|
||||||
# Hosts which require special configuration options can be listed in
|
|
||||||
# host statements. If no address is specified, the address will be
|
|
||||||
# allocated dynamically (if possible), but the host-specific information
|
|
||||||
# will still come from the host declaration.
|
|
||||||
|
|
||||||
#host passacaglia {
|
|
||||||
# hardware ethernet 0:0:c0:5d:bd:95;
|
|
||||||
# filename "vmunix.passacaglia";
|
|
||||||
# server-name "toccata.example.com";
|
|
||||||
#}
|
|
||||||
|
|
||||||
# Fixed IP addresses can also be specified for hosts. These addresses
|
|
||||||
# should not also be listed as being available for dynamic assignment.
|
|
||||||
# Hosts for which fixed IP addresses have been specified can boot using
|
|
||||||
# BOOTP or DHCP. Hosts for which no fixed address is specified can only
|
|
||||||
# be booted with DHCP, unless there is an address range on the subnet
|
|
||||||
# to which a BOOTP client is connected which has the dynamic-bootp flag
|
|
||||||
# set.
|
|
||||||
#host fantasia {
|
|
||||||
# hardware ethernet 08:00:07:26:c0:a5;
|
|
||||||
# fixed-address fantasia.example.com;
|
|
||||||
#}
|
|
||||||
|
|
||||||
# You can declare a class of clients and then do address allocation
|
|
||||||
# based on that. The example below shows a case where all clients
|
|
||||||
# in a certain class get addresses on the 10.17.224/24 subnet, and all
|
|
||||||
# other clients get addresses on the 10.0.29/24 subnet.
|
|
||||||
|
|
||||||
#class "foo" {
|
|
||||||
# match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
|
|
||||||
#}
|
|
||||||
|
|
||||||
#shared-network 224-29 {
|
|
||||||
# subnet 10.17.224.0 netmask 255.255.255.0 {
|
|
||||||
# option routers rtr-224.example.org;
|
|
||||||
# }
|
|
||||||
# subnet 10.0.29.0 netmask 255.255.255.0 {
|
|
||||||
# option routers rtr-29.example.org;
|
|
||||||
# }
|
|
||||||
# pool {
|
|
||||||
# allow members of "foo";
|
|
||||||
# range 10.17.224.10 10.17.224.250;
|
|
||||||
# }
|
|
||||||
# pool {
|
|
||||||
# deny members of "foo";
|
|
||||||
# range 10.0.29.10 10.0.29.230;
|
|
||||||
# }
|
|
||||||
#}
|
|
||||||
default-lease-time 86400; # durée du bail en secondes
|
|
||||||
max-lease-time 86400; # durée du bail en secondes
|
|
||||||
|
|
||||||
option domain-name-servers 192.168.0.1; # adr. des serveurs DNS
|
|
||||||
option domain-name "sio.lan"; #nom du domaine DNS
|
|
||||||
option netbios-name-servers 192.168.1.1; # adr. du serveur WINS
|
|
||||||
option netbios-node-type 8; # type de noeud NetBios (WINS puis broadcast)
|
|
||||||
|
|
||||||
subnet 192.168.1.0 netmask 255.255.255.0 {
|
|
||||||
option subnet-mask 255.255.255.0;
|
|
||||||
option broadcast-address 192.168.1.255;
|
|
||||||
option routers 192.168.1.1; # passerelle par defaut
|
|
||||||
range 192.168.1.10 192.168.1.20;
|
|
||||||
filename "pxelinux.0";
|
|
||||||
next-server 192.168.1.1; #serveur TFTP
|
|
||||||
option subnet-mask 255.255.255.0;
|
|
||||||
option broadcast-address 192.168.1.255;
|
|
||||||
option routers 192.168.1.1; }
|
|
@ -1,4 +0,0 @@
|
|||||||
YOURMIRROR=deb.debian.org
|
|
||||||
DIST=bullseye
|
|
||||||
ARCH=amd64
|
|
||||||
wget http://"$YOURMIRROR"/debian/dists/"$DIST"/main/installer-"$ARCH"/current/images/netboot/netboot.tar.gz
|
|
@ -1,18 +0,0 @@
|
|||||||
# Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server)
|
|
||||||
|
|
||||||
# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
|
|
||||||
DHCPDv4_CONF=/etc/dhcp/dhcpd.conf
|
|
||||||
#DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf
|
|
||||||
|
|
||||||
# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
|
|
||||||
DHCPDv4_PID=/var/run/dhcpd.pid
|
|
||||||
#DHCPDv6_PID=/var/run/dhcpd6.pid
|
|
||||||
|
|
||||||
# Additional options to start dhcpd with.
|
|
||||||
# Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
|
|
||||||
#OPTIONS=""
|
|
||||||
|
|
||||||
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
|
|
||||||
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
|
|
||||||
INTERFACESv4="enp0s8"
|
|
||||||
INTERFACESv6=""
|
|
@ -1,3 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
echo "1" > /proc/sys/net/ipv4/ip_forward
|
|
||||||
sudo iptables -t nat -A POSTROUTING -o enp0s3 -j MASQUERADE
|
|
File diff suppressed because it is too large
Load Diff
@ -1,306 +0,0 @@
|
|||||||
###############################################################################
|
|
||||||
# COMMANDS.CFG - SAMPLE COMMAND DEFINITIONS FOR NAGIOS 4.4.6
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# NOTES: This config file provides you with some example command definitions
|
|
||||||
# that you can reference in host, service, and contact definitions.
|
|
||||||
#
|
|
||||||
# You don't need to keep commands in a separate file from your other
|
|
||||||
# object definitions. This has been done just to make things easier to
|
|
||||||
# understand.
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
#
|
|
||||||
# SAMPLE NOTIFICATION COMMANDS
|
|
||||||
#
|
|
||||||
# These are some example notification commands. They may or may not work on
|
|
||||||
# your system without modification. As an example, some systems will require
|
|
||||||
# you to use "/usr/bin/mailx" instead of "/usr/bin/mail" in the commands below.
|
|
||||||
#
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
define command {
|
|
||||||
|
|
||||||
command_name notify-host-by-email
|
|
||||||
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
define command {
|
|
||||||
|
|
||||||
command_name notify-service-by-email
|
|
||||||
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
#
|
|
||||||
# SAMPLE HOST CHECK COMMANDS
|
|
||||||
#
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same name
|
|
||||||
# defined in ping.cfg, which is part of monitoring-plugins-basic.
|
|
||||||
#
|
|
||||||
## This command checks to see if a host is "alive" by pinging it
|
|
||||||
## The check must result in a 100% packet loss or 5 second (5000ms) round trip
|
|
||||||
## average time to produce a critical error.
|
|
||||||
## Note: Five ICMP echo packets are sent (determined by the '-p 5' argument)
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check-host-alive
|
|
||||||
# command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
#
|
|
||||||
# SAMPLE SERVICE CHECK COMMANDS
|
|
||||||
#
|
|
||||||
# These are some example service check commands. They may or may not work on
|
|
||||||
# your system, as they must be modified for your plugins. See the HTML
|
|
||||||
# documentation on the plugins for examples of how to configure command definitions.
|
|
||||||
#
|
|
||||||
# NOTE: The following 'check_local_...' functions are designed to monitor
|
|
||||||
# various metrics on the host that Nagios is running on (i.e. this one).
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
define command {
|
|
||||||
|
|
||||||
command_name check_local_disk
|
|
||||||
command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
define command {
|
|
||||||
|
|
||||||
command_name check_local_load
|
|
||||||
command_line $USER1$/check_load -w $ARG1$ -c $ARG2$
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
define command {
|
|
||||||
|
|
||||||
command_name check_local_procs
|
|
||||||
command_line $USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
define command {
|
|
||||||
|
|
||||||
command_name check_local_users
|
|
||||||
command_line $USER1$/check_users -w $ARG1$ -c $ARG2$
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
define command {
|
|
||||||
|
|
||||||
command_name check_local_swap
|
|
||||||
command_line $USER1$/check_swap -w $ARG1$ -c $ARG2$
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
define command {
|
|
||||||
|
|
||||||
command_name check_local_mrtgtraf
|
|
||||||
command_line $USER1$/check_mrtgtraf -F $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -e $ARG5$
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# NOTE: The following 'check_...' commands are used to monitor services on
|
|
||||||
# both local and remote hosts.
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same of
|
|
||||||
# defined in ftp.cfg, which is part of monitoring-plugins-basic.
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check_ftp
|
|
||||||
# command_line $USER1$/check_ftp -H $HOSTADDRESS$ $ARG1$
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same of
|
|
||||||
# defined in hppjd.cfg, which is part of monitoring-plugins-standard.
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check_hpjd
|
|
||||||
# command_line $USER1$/check_hpjd -H $HOSTADDRESS$ $ARG1$
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
define command {
|
|
||||||
|
|
||||||
command_name check_snmp
|
|
||||||
command_line $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same of
|
|
||||||
# defined in http.cfg, which is part of monitoring-plugins-basic.
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check_http
|
|
||||||
# command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same of
|
|
||||||
# defined in ssh.cfg, which is part of monitoring-plugins-basic.
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check_ssh
|
|
||||||
# command_line $USER1$/check_ssh $ARG1$ $HOSTADDRESS$
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same of
|
|
||||||
# defined in dhcp.cfg, which is part of monitoring-plugins-basic.
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check_dhcp
|
|
||||||
# command_line $USER1$/check_dhcp $ARG1$
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same of
|
|
||||||
# defined in ping.cfg, which is part of monitoring-plugins-basic.
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check_ping
|
|
||||||
# command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same of
|
|
||||||
# defined in mail.cfg, which is part of monitoring-plugins-basic.
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check_pop
|
|
||||||
# command_line $USER1$/check_pop -H $HOSTADDRESS$ $ARG1$
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same of
|
|
||||||
# defined in mail.cfg, which is part of monitoring-plugins-basic.
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check_imap
|
|
||||||
# command_line $USER1$/check_imap -H $HOSTADDRESS$ $ARG1$
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same of
|
|
||||||
# defined in mail.cfg, which is part of monitoring-plugins-basic.
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check_smtp
|
|
||||||
# command_line $USER1$/check_smtp -H $HOSTADDRESS$ $ARG1$
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same of
|
|
||||||
# defined in tcp_ucp.cfg, which is part of monitoring-plugins-basic.
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check_tcp
|
|
||||||
# command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same of
|
|
||||||
# defined in tcp_ucp.cfg, which is part of monitoring-plugins-basic.
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check_udp
|
|
||||||
# command_line $USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same of
|
|
||||||
# defined in nt.cfg, which is part of monitoring-plugins-standard.
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check_nt
|
|
||||||
# command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
#
|
|
||||||
# SAMPLE PERFORMANCE DATA COMMANDS
|
|
||||||
#
|
|
||||||
# These are sample performance data commands that can be used to send performance
|
|
||||||
# data output to two text files (one for hosts, another for services). If you
|
|
||||||
# plan on simply writing performance data out to a file, consider using the
|
|
||||||
# host_perfdata_file and service_perfdata_file options in the main config file.
|
|
||||||
#
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
define command {
|
|
||||||
|
|
||||||
command_name process-host-perfdata
|
|
||||||
command_line /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" >> /var/lib/nagios4/host-perfdata.out
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
define command {
|
|
||||||
|
|
||||||
command_name process-service-perfdata
|
|
||||||
command_line /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" >> /var/lib/nagios4/service-perfdata.out
|
|
||||||
}
|
|
||||||
|
|
||||||
define command {
|
|
||||||
command_name check_lin_load
|
|
||||||
command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ -C $ARG1$ $ARG2$ -T $ARG3$ -w $ARG4$ -c $ARG5$
|
|
||||||
}
|
|
||||||
|
|
||||||
define command {
|
|
||||||
command_name chk_dns_ext
|
|
||||||
command_line $USER1$/check_dns -s $HOSTADDRESS$ -H www.google.com
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,295 +0,0 @@
|
|||||||
###############################################################################
|
|
||||||
# COMMANDS.CFG - SAMPLE COMMAND DEFINITIONS FOR NAGIOS 4.4.6
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# NOTES: This config file provides you with some example command definitions
|
|
||||||
# that you can reference in host, service, and contact definitions.
|
|
||||||
#
|
|
||||||
# You don't need to keep commands in a separate file from your other
|
|
||||||
# object definitions. This has been done just to make things easier to
|
|
||||||
# understand.
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
#
|
|
||||||
# SAMPLE NOTIFICATION COMMANDS
|
|
||||||
#
|
|
||||||
# These are some example notification commands. They may or may not work on
|
|
||||||
# your system without modification. As an example, some systems will require
|
|
||||||
# you to use "/usr/bin/mailx" instead of "/usr/bin/mail" in the commands below.
|
|
||||||
#
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
define command {
|
|
||||||
|
|
||||||
command_name notify-host-by-email
|
|
||||||
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
define command {
|
|
||||||
|
|
||||||
command_name notify-service-by-email
|
|
||||||
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
#
|
|
||||||
# SAMPLE HOST CHECK COMMANDS
|
|
||||||
#
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same name
|
|
||||||
# defined in ping.cfg, which is part of monitoring-plugins-basic.
|
|
||||||
#
|
|
||||||
## This command checks to see if a host is "alive" by pinging it
|
|
||||||
## The check must result in a 100% packet loss or 5 second (5000ms) round trip
|
|
||||||
## average time to produce a critical error.
|
|
||||||
## Note: Five ICMP echo packets are sent (determined by the '-p 5' argument)
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check-host-alive
|
|
||||||
# command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
#
|
|
||||||
# SAMPLE SERVICE CHECK COMMANDS
|
|
||||||
#
|
|
||||||
# These are some example service check commands. They may or may not work on
|
|
||||||
# your system, as they must be modified for your plugins. See the HTML
|
|
||||||
# documentation on the plugins for examples of how to configure command definitions.
|
|
||||||
#
|
|
||||||
# NOTE: The following 'check_local_...' functions are designed to monitor
|
|
||||||
# various metrics on the host that Nagios is running on (i.e. this one).
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
define command {
|
|
||||||
|
|
||||||
command_name check_local_disk
|
|
||||||
command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
define command {
|
|
||||||
|
|
||||||
command_name check_local_load
|
|
||||||
command_line $USER1$/check_load -w $ARG1$ -c $ARG2$
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
define command {
|
|
||||||
|
|
||||||
command_name check_local_procs
|
|
||||||
command_line $USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
define command {
|
|
||||||
|
|
||||||
command_name check_local_users
|
|
||||||
command_line $USER1$/check_users -w $ARG1$ -c $ARG2$
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
define command {
|
|
||||||
|
|
||||||
command_name check_local_swap
|
|
||||||
command_line $USER1$/check_swap -w $ARG1$ -c $ARG2$
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
define command {
|
|
||||||
|
|
||||||
command_name check_local_mrtgtraf
|
|
||||||
command_line $USER1$/check_mrtgtraf -F $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -e $ARG5$
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# NOTE: The following 'check_...' commands are used to monitor services on
|
|
||||||
# both local and remote hosts.
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same of
|
|
||||||
# defined in ftp.cfg, which is part of monitoring-plugins-basic.
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check_ftp
|
|
||||||
# command_line $USER1$/check_ftp -H $HOSTADDRESS$ $ARG1$
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same of
|
|
||||||
# defined in hppjd.cfg, which is part of monitoring-plugins-standard.
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check_hpjd
|
|
||||||
# command_line $USER1$/check_hpjd -H $HOSTADDRESS$ $ARG1$
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
define command {
|
|
||||||
|
|
||||||
command_name check_snmp
|
|
||||||
command_line $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same of
|
|
||||||
# defined in http.cfg, which is part of monitoring-plugins-basic.
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check_http
|
|
||||||
# command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same of
|
|
||||||
# defined in ssh.cfg, which is part of monitoring-plugins-basic.
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check_ssh
|
|
||||||
# command_line $USER1$/check_ssh $ARG1$ $HOSTADDRESS$
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same of
|
|
||||||
# defined in dhcp.cfg, which is part of monitoring-plugins-basic.
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check_dhcp
|
|
||||||
# command_line $USER1$/check_dhcp $ARG1$
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same of
|
|
||||||
# defined in ping.cfg, which is part of monitoring-plugins-basic.
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check_ping
|
|
||||||
# command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same of
|
|
||||||
# defined in mail.cfg, which is part of monitoring-plugins-basic.
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check_pop
|
|
||||||
# command_line $USER1$/check_pop -H $HOSTADDRESS$ $ARG1$
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same of
|
|
||||||
# defined in mail.cfg, which is part of monitoring-plugins-basic.
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check_imap
|
|
||||||
# command_line $USER1$/check_imap -H $HOSTADDRESS$ $ARG1$
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same of
|
|
||||||
# defined in mail.cfg, which is part of monitoring-plugins-basic.
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check_smtp
|
|
||||||
# command_line $USER1$/check_smtp -H $HOSTADDRESS$ $ARG1$
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same of
|
|
||||||
# defined in tcp_ucp.cfg, which is part of monitoring-plugins-basic.
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check_tcp
|
|
||||||
# command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same of
|
|
||||||
# defined in tcp_ucp.cfg, which is part of monitoring-plugins-basic.
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check_udp
|
|
||||||
# command_line $USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Removed in Debian because it conflicts with the command of the same of
|
|
||||||
# defined in nt.cfg, which is part of monitoring-plugins-standard.
|
|
||||||
#
|
|
||||||
#define command {
|
|
||||||
#
|
|
||||||
# command_name check_nt
|
|
||||||
# command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
#
|
|
||||||
# SAMPLE PERFORMANCE DATA COMMANDS
|
|
||||||
#
|
|
||||||
# These are sample performance data commands that can be used to send performance
|
|
||||||
# data output to two text files (one for hosts, another for services). If you
|
|
||||||
# plan on simply writing performance data out to a file, consider using the
|
|
||||||
# host_perfdata_file and service_perfdata_file options in the main config file.
|
|
||||||
#
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
define command {
|
|
||||||
|
|
||||||
command_name process-host-perfdata
|
|
||||||
command_line /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" >> /var/lib/nagios4/host-perfdata.out
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
define command {
|
|
||||||
|
|
||||||
command_name process-service-perfdata
|
|
||||||
command_line /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" >> /var/lib/nagios4/service-perfdata.out
|
|
||||||
}
|
|
||||||
define command {
|
|
||||||
command_name check_lin_loadcommand_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ -C $ARG1$ $ARG2$ -T $ARG3$ -w $ARG4$ -c $ARG5$
|
|
||||||
}
|
|
@ -1,51 +0,0 @@
|
|||||||
###############################################################################
|
|
||||||
# CONTACTS.CFG - SAMPLE CONTACT/CONTACTGROUP DEFINITIONS
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# NOTES: This config file provides you with some example contact and contact
|
|
||||||
# group definitions that you can reference in host and service
|
|
||||||
# definitions.
|
|
||||||
#
|
|
||||||
# You don't need to keep these definitions in a separate file from your
|
|
||||||
# other object definitions. This has been done just to make things
|
|
||||||
# easier to understand.
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
#
|
|
||||||
# CONTACTS
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
# Just one contact defined by default - the Nagios admin (that's you)
|
|
||||||
# This contact definition inherits a lot of default values from the
|
|
||||||
# 'generic-contact' template which is defined elsewhere.
|
|
||||||
|
|
||||||
define contact {
|
|
||||||
|
|
||||||
contact_name nagiosadmin ; Short name of user
|
|
||||||
use generic-contact ; Inherit default values from generic-contact template (defined above)
|
|
||||||
alias Nagios Admin ; Full name of user
|
|
||||||
email supervisionraphanaud@gmail.com ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
#
|
|
||||||
# CONTACT GROUPS
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
# We only have one contact in this simple configuration file, so there is
|
|
||||||
# no need to create more than one contact group.
|
|
||||||
|
|
||||||
define contactgroup {
|
|
||||||
|
|
||||||
contactgroup_name admins
|
|
||||||
alias Nagios Administrators
|
|
||||||
members nagiosadmin
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
define host {
|
|
||||||
use linux-server ; Name of host template to use
|
|
||||||
host_name gwsio3
|
|
||||||
alias gwsio3
|
|
||||||
address 192.168.0.1
|
|
||||||
}
|
|
||||||
define service{
|
|
||||||
use generic-service
|
|
||||||
host_name gwsio3
|
|
||||||
service_description check-dns-ext
|
|
||||||
check_command chk_dns_ext
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
define hostgroup {
|
|
||||||
|
|
||||||
hostgroup_name linux-servers ; The name of the hostgroup
|
|
||||||
alias Linux Servers ; Long name of the group
|
|
||||||
members srv, gwsio3 ; Comma separated list of hosts that b>
|
|
||||||
}
|
|
||||||
|
|
||||||
#define hostgroup {
|
|
||||||
|
|
||||||
# hostgroup_name windows-servers ; The name of the hostgroup
|
|
||||||
# alias Windows Servers ; Long name of the group
|
|
||||||
# members srvwin ; Comma separated list of hosts t>
|
|
||||||
#}
|
|
@ -1,140 +0,0 @@
|
|||||||
###############################################################################
|
|
||||||
# LOCALHOST.CFG - SAMPLE OBJECT CONFIG FILE FOR MONITORING THIS MACHINE
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# NOTE: This config file is intended to serve as an *extremely* simple
|
|
||||||
# example of how you can create configuration entries to monitor
|
|
||||||
# the local (Linux) machine.
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
#
|
|
||||||
# HOST DEFINITION
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
# Define a host for the local machine
|
|
||||||
|
|
||||||
define host {
|
|
||||||
|
|
||||||
use linux-server ; Name of host template to use
|
|
||||||
; This host definition will inherit all variables that are defined
|
|
||||||
; in (or inherited by) the linux-server host template definition.
|
|
||||||
host_name localhost
|
|
||||||
alias localhost
|
|
||||||
address 127.0.0.1
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#DEFINITIONS
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
# Define a service to "ping" the local machine
|
|
||||||
|
|
||||||
define service {
|
|
||||||
|
|
||||||
use local-service ; Name of service template to use
|
|
||||||
host_name localhost
|
|
||||||
service_description PING
|
|
||||||
check_command check_ping!100.0,20%!500.0,60%
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 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 {
|
|
||||||
|
|
||||||
use local-service ; Name of service template to use
|
|
||||||
host_name localhost
|
|
||||||
service_description Root Partition
|
|
||||||
check_command check_local_disk!20%!10%!/
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 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 {
|
|
||||||
|
|
||||||
use local-service ; Name of service template to use
|
|
||||||
host_name localhost
|
|
||||||
service_description Current Users
|
|
||||||
check_command check_local_users!20!50
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Define a service to check the number of currently running procs
|
|
||||||
# on the local machine. Warning if > 250 processes, critical if
|
|
||||||
# > 400 processes.
|
|
||||||
|
|
||||||
define service {
|
|
||||||
|
|
||||||
use local-service ; Name of service template to use
|
|
||||||
host_name localhost
|
|
||||||
service_description Total Processes
|
|
||||||
check_command check_local_procs!250!400!RSZDT
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Define a service to check the load on the local machine.
|
|
||||||
|
|
||||||
define service {
|
|
||||||
|
|
||||||
use local-service ; Name of service template to use
|
|
||||||
host_name localhost
|
|
||||||
service_description Current Load
|
|
||||||
check_command check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Define a service to check the swap usage the local machine.
|
|
||||||
# Critical if less than 10% of swap is free, warning if less than 20% is free
|
|
||||||
|
|
||||||
define service {
|
|
||||||
|
|
||||||
use local-service ; Name of service template to use
|
|
||||||
host_name localhost
|
|
||||||
service_description Swap Usage
|
|
||||||
check_command check_local_swap!20%!10%
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Define a service to check SSH on the local machine.
|
|
||||||
# Disable notifications for this service by default, as not all users may have SSH enabled.
|
|
||||||
|
|
||||||
define service {
|
|
||||||
|
|
||||||
use local-service ; Name of service template to use
|
|
||||||
host_name localhost
|
|
||||||
service_description SSH
|
|
||||||
check_command check_ssh
|
|
||||||
notifications_enabled 0
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Define a service to check HTTP on the local machine.
|
|
||||||
# Disable notifications for this service by default, as not all users may have HTTP enabled.
|
|
||||||
|
|
||||||
define service {
|
|
||||||
|
|
||||||
use local-service ; Name of service template to use
|
|
||||||
host_name localhost
|
|
||||||
service_description HTTP
|
|
||||||
check_command check_http
|
|
||||||
notifications_enabled 0
|
|
||||||
}
|
|
@ -1,82 +0,0 @@
|
|||||||
###############################################################################
|
|
||||||
# PRINTER.CFG - SAMPLE CONFIG FILE FOR MONITORING A NETWORK PRINTER
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# NOTES: This config file assumes that you are using the sample configuration
|
|
||||||
# files that get installed with the Nagios quickstart guide.
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
#
|
|
||||||
# HOST DEFINITIONS
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
# Define a host for the printer we'll be monitoring
|
|
||||||
# Change the host_name, alias, and address to fit your situation
|
|
||||||
|
|
||||||
define host {
|
|
||||||
|
|
||||||
use generic-printer ; Inherit default values from a template
|
|
||||||
host_name hplj2605dn ; The name we're giving to this printer
|
|
||||||
alias HP LaserJet 2605dn ; A longer name associated with the printer
|
|
||||||
address 192.168.1.30 ; IP address of the printer
|
|
||||||
hostgroups network-printers ; Host groups this printer is associated with
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
#
|
|
||||||
# HOST GROUP DEFINITIONS
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
# A hostgroup for network printers
|
|
||||||
|
|
||||||
define hostgroup {
|
|
||||||
|
|
||||||
hostgroup_name network-printers ; The name of the hostgroup
|
|
||||||
alias Network Printers ; Long name of the group
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
#
|
|
||||||
# SERVICE DEFINITIONS
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
# Create a service for monitoring the status of the printer
|
|
||||||
# Change the host_name to match the name of the host you defined above
|
|
||||||
# If the printer has an SNMP community string other than "public",
|
|
||||||
# change the check_command directive to reflect that
|
|
||||||
|
|
||||||
define service {
|
|
||||||
|
|
||||||
use generic-service ; Inherit values from a template
|
|
||||||
host_name hplj2605dn ; The name of the host the service is associated with
|
|
||||||
service_description Printer Status ; The service description
|
|
||||||
check_command check_hpjd!-C public ; The command used to monitor the service
|
|
||||||
check_interval 10 ; Check the service every 10 minutes under normal conditions
|
|
||||||
retry_interval 1 ; Re-check the service every minute until its final/hard state is determined
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Create a service for "pinging" the printer occasionally.
|
|
||||||
# Useful for monitoring RTA, packet loss, etc.
|
|
||||||
|
|
||||||
define service {
|
|
||||||
|
|
||||||
use generic-service
|
|
||||||
host_name hplj2605dn
|
|
||||||
service_description PING
|
|
||||||
check_command check_ping!3000.0,80%!5000.0,100%
|
|
||||||
check_interval 10
|
|
||||||
retry_interval 1
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
define host {
|
|
||||||
use linux-server ; Name of host template to use
|
|
||||||
host_name srv
|
|
||||||
alias srv
|
|
||||||
address 192.168.0.26
|
|
||||||
parents localhost
|
|
||||||
}
|
|
||||||
define service{
|
|
||||||
use generic-service
|
|
||||||
host_name srv
|
|
||||||
service_description WWW
|
|
||||||
check_command check_http
|
|
||||||
}
|
|
||||||
define service{
|
|
||||||
use generic-service
|
|
||||||
host_name srv
|
|
||||||
service_description ssh
|
|
||||||
check_command check_ssh
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
define host {
|
|
||||||
use windows-servers
|
|
||||||
host_name srvwin
|
|
||||||
alias srvwin
|
|
||||||
address 192.168.0.21
|
|
||||||
}
|
|
@ -1,99 +0,0 @@
|
|||||||
###############################################################################
|
|
||||||
# SWITCH.CFG - SAMPLE CONFIG FILE FOR MONITORING A SWITCH
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# NOTES: This config file assumes that you are using the sample configuration
|
|
||||||
# files that get installed with the Nagios quickstart guide.
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
#
|
|
||||||
# HOST DEFINITIONS
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
# Define the switch that we'll be monitoring
|
|
||||||
|
|
||||||
define host {
|
|
||||||
|
|
||||||
use generic-switch ; Inherit default values from a template
|
|
||||||
host_name linksys-srw224p ; The name we're giving to this switch
|
|
||||||
alias Linksys SRW224P Switch ; A longer name associated with the switch
|
|
||||||
address 192.168.1.253 ; IP address of the switch
|
|
||||||
hostgroups switches ; Host groups this switch is associated with
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
#
|
|
||||||
# HOST GROUP DEFINITIONS
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
# Create a new hostgroup for switches
|
|
||||||
|
|
||||||
define hostgroup {
|
|
||||||
|
|
||||||
hostgroup_name switches ; The name of the hostgroup
|
|
||||||
alias Network Switches ; Long name of the group
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
#
|
|
||||||
# SERVICE DEFINITIONS
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
# Create a service to PING to switch
|
|
||||||
|
|
||||||
define service {
|
|
||||||
|
|
||||||
use generic-service ; Inherit values from a template
|
|
||||||
host_name linksys-srw224p ; The name of the host the service is associated with
|
|
||||||
service_description PING ; The service description
|
|
||||||
check_command check_ping!200.0,20%!600.0,60% ; The command used to monitor the service
|
|
||||||
check_interval 5 ; Check the service every 5 minutes under normal conditions
|
|
||||||
retry_interval 1 ; Re-check the service every minute until its final/hard state is determined
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Monitor uptime via SNMP
|
|
||||||
|
|
||||||
define service {
|
|
||||||
|
|
||||||
use generic-service ; Inherit values from a template
|
|
||||||
host_name linksys-srw224p
|
|
||||||
service_description Uptime
|
|
||||||
check_command check_snmp!-C public -o sysUpTime.0
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Monitor Port 1 status via SNMP
|
|
||||||
|
|
||||||
define service {
|
|
||||||
|
|
||||||
use generic-service ; Inherit values from a template
|
|
||||||
host_name linksys-srw224p
|
|
||||||
service_description Port 1 Link Status
|
|
||||||
check_command check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Monitor bandwidth via MRTG logs
|
|
||||||
|
|
||||||
define service {
|
|
||||||
|
|
||||||
use generic-service ; Inherit values from a template
|
|
||||||
host_name linksys-srw224p
|
|
||||||
service_description Port 1 Bandwidth Usage
|
|
||||||
check_command check_local_mrtgtraf!/var/lib/mrtg/192.168.1.253_1.log!AVG!1000000,1000000!5000000,5000000!10
|
|
||||||
}
|
|
@ -1,206 +0,0 @@
|
|||||||
###############################################################################
|
|
||||||
# TEMPLATES.CFG - SAMPLE OBJECT TEMPLATES
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# NOTES: This config file provides you with some example object definition
|
|
||||||
# templates that are referred by other host, service, contact, etc.
|
|
||||||
# definitions in other config files.
|
|
||||||
#
|
|
||||||
# You don't need to keep these definitions in a separate file from your
|
|
||||||
# other object definitions. This has been done just to make things
|
|
||||||
# easier to understand.
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
#
|
|
||||||
# CONTACT TEMPLATES
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
# Generic contact definition template
|
|
||||||
# This is NOT a real contact, just a template!
|
|
||||||
|
|
||||||
define contact {
|
|
||||||
|
|
||||||
name generic-contact ; The name of this contact template
|
|
||||||
service_notification_period 24x7 ; service notifications can be sent anytime
|
|
||||||
host_notification_period 24x7 ; host notifications can be sent anytime
|
|
||||||
service_notification_options w,u,c,r,f,s ; send notifications for all service states, flapping events, and scheduled downtime events
|
|
||||||
host_notification_options d,u,r,f,s ; send notifications for all host states, flapping events, and scheduled downtime events
|
|
||||||
service_notification_commands notify-service-by-email ; send service notifications via email
|
|
||||||
host_notification_commands notify-host-by-email ; send host notifications via email
|
|
||||||
register 0 ; DON'T REGISTER THIS DEFINITION - ITS NOT A REAL CONTACT, JUST A TEMPLATE!
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
#
|
|
||||||
# HOST TEMPLATES
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
# Generic host definition template
|
|
||||||
# This is NOT a real host, just a template!
|
|
||||||
|
|
||||||
define host {
|
|
||||||
|
|
||||||
name generic-host ; The name of this host template
|
|
||||||
notifications_enabled 1 ; Host notifications are enabled
|
|
||||||
event_handler_enabled 1 ; Host event handler is enabled
|
|
||||||
flap_detection_enabled 1 ; Flap detection is enabled
|
|
||||||
process_perf_data 1 ; Process performance data
|
|
||||||
retain_status_information 1 ; Retain status information across program restarts
|
|
||||||
retain_nonstatus_information 1 ; Retain non-status information across program restarts
|
|
||||||
notification_period 24x7 ; Send host notifications at any time
|
|
||||||
register 0 ; DON'T REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Linux host definition template
|
|
||||||
# This is NOT a real host, just a template!
|
|
||||||
|
|
||||||
define host {
|
|
||||||
|
|
||||||
name linux-server ; The name of this host template
|
|
||||||
use generic-host ; This template inherits other values from the generic-host template
|
|
||||||
check_period 24x7 ; By default, Linux hosts are checked round the clock
|
|
||||||
check_interval 5 ; Actively check the host every 5 minutes
|
|
||||||
retry_interval 1 ; Schedule host check retries at 1 minute intervals
|
|
||||||
max_check_attempts 10 ; Check each Linux host 10 times (max)
|
|
||||||
check_command check-host-alive ; Default command to check Linux hosts
|
|
||||||
notification_period workhours ; Linux admins hate to be woken up, so we only notify during the day
|
|
||||||
; Note that the notification_period variable is being overridden from
|
|
||||||
; the value that is inherited from the generic-host template!
|
|
||||||
notification_interval 120 ; Resend notifications every 2 hours
|
|
||||||
notification_options d,u,r ; Only send notifications for specific host states
|
|
||||||
contact_groups admins ; Notifications get sent to the admins by default
|
|
||||||
register 0 ; DON'T REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Windows host definition template
|
|
||||||
# This is NOT a real host, just a template!
|
|
||||||
|
|
||||||
define host {
|
|
||||||
|
|
||||||
name windows-server ; The name of this host template
|
|
||||||
use generic-host ; Inherit default values from the generic-host template
|
|
||||||
check_period 24x7 ; By default, Windows servers are monitored round the clock
|
|
||||||
check_interval 5 ; Actively check the server every 5 minutes
|
|
||||||
retry_interval 1 ; Schedule host check retries at 1 minute intervals
|
|
||||||
max_check_attempts 10 ; Check each server 10 times (max)
|
|
||||||
check_command check-host-alive ; Default command to check if servers are "alive"
|
|
||||||
notification_period 24x7 ; Send notification out at any time - day or night
|
|
||||||
notification_interval 30 ; Resend notifications every 30 minutes
|
|
||||||
notification_options d,r ; Only send notifications for specific host states
|
|
||||||
contact_groups admins ; Notifications get sent to the admins by default
|
|
||||||
hostgroups windows-servers ; Host groups that Windows servers should be a member of
|
|
||||||
register 0 ; DON'T REGISTER THIS - ITS JUST A TEMPLATE
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# We define a generic printer template that can
|
|
||||||
# be used for most printers we monitor
|
|
||||||
|
|
||||||
define host {
|
|
||||||
|
|
||||||
name generic-printer ; The name of this host template
|
|
||||||
use generic-host ; Inherit default values from the generic-host template
|
|
||||||
check_period 24x7 ; By default, printers are monitored round the clock
|
|
||||||
check_interval 5 ; Actively check the printer every 5 minutes
|
|
||||||
retry_interval 1 ; Schedule host check retries at 1 minute intervals
|
|
||||||
max_check_attempts 10 ; Check each printer 10 times (max)
|
|
||||||
check_command check-host-alive ; Default command to check if printers are "alive"
|
|
||||||
notification_period workhours ; Printers are only used during the workday
|
|
||||||
notification_interval 30 ; Resend notifications every 30 minutes
|
|
||||||
notification_options d,r ; Only send notifications for specific host states
|
|
||||||
contact_groups admins ; Notifications get sent to the admins by default
|
|
||||||
register 0 ; DON'T REGISTER THIS - ITS JUST A TEMPLATE
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Define a template for switches that we can reuse
|
|
||||||
define host {
|
|
||||||
|
|
||||||
name generic-switch ; The name of this host template
|
|
||||||
use generic-host ; Inherit default values from the generic-host template
|
|
||||||
check_period 24x7 ; By default, switches are monitored round the clock
|
|
||||||
check_interval 5 ; Switches are checked every 5 minutes
|
|
||||||
retry_interval 1 ; Schedule host check retries at 1 minute intervals
|
|
||||||
max_check_attempts 10 ; Check each switch 10 times (max)
|
|
||||||
check_command check-host-alive ; Default command to check if routers are "alive"
|
|
||||||
notification_period 24x7 ; Send notifications at any time
|
|
||||||
notification_interval 30 ; Resend notifications every 30 minutes
|
|
||||||
notification_options d,r ; Only send notifications for specific host states
|
|
||||||
contact_groups admins ; Notifications get sent to the admins by default
|
|
||||||
register 0 ; DON'T REGISTER THIS - ITS JUST A TEMPLATE
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
#
|
|
||||||
# SERVICE TEMPLATES
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
# Generic service definition template
|
|
||||||
# This is NOT a real service, just a template!
|
|
||||||
|
|
||||||
define service {
|
|
||||||
|
|
||||||
name generic-service ; The 'name' of this service template
|
|
||||||
active_checks_enabled 1 ; Active service checks are enabled
|
|
||||||
passive_checks_enabled 1 ; Passive service checks are enabled/accepted
|
|
||||||
parallelize_check 1 ; Active service checks should be parallelized (disabling this can lead to major performance problems)
|
|
||||||
obsess_over_service 1 ; We should obsess over this service (if necessary)
|
|
||||||
check_freshness 0 ; Default is to NOT check service 'freshness'
|
|
||||||
notifications_enabled 1 ; Service notifications are enabled
|
|
||||||
event_handler_enabled 1 ; Service event handler is enabled
|
|
||||||
flap_detection_enabled 1 ; Flap detection is enabled
|
|
||||||
process_perf_data 1 ; Process performance data
|
|
||||||
retain_status_information 1 ; Retain status information across program restarts
|
|
||||||
retain_nonstatus_information 1 ; Retain non-status information across program restarts
|
|
||||||
is_volatile 0 ; The service is not volatile
|
|
||||||
check_period 24x7 ; The service can be checked at any time of the day
|
|
||||||
max_check_attempts 3 ; Re-check the service up to 3 times in order to determine its final (hard) state
|
|
||||||
check_interval 10 ; Check the service every 10 minutes under normal conditions
|
|
||||||
retry_interval 2 ; Re-check the service every two minutes until a hard state can be determined
|
|
||||||
contact_groups admins ; Notifications get sent out to everyone in the 'admins' group
|
|
||||||
notification_options w,u,c,r ; Send notifications about warning, unknown, critical, and recovery events
|
|
||||||
notification_interval 60 ; Re-notify about service problems every hour
|
|
||||||
notification_period 24x7 ; Notifications can be sent out at any time
|
|
||||||
register 0 ; DON'T REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Local service definition template
|
|
||||||
# This is NOT a real service, just a template!
|
|
||||||
|
|
||||||
define service {
|
|
||||||
|
|
||||||
name local-service ; The name of this service template
|
|
||||||
use generic-service ; Inherit default values from the generic-service definition
|
|
||||||
max_check_attempts 4 ; Re-check the service up to 4 times in order to determine its final (hard) state
|
|
||||||
check_interval 5 ; Check the service every 5 minutes under normal conditions
|
|
||||||
retry_interval 1 ; Re-check the service every minute until a hard state can be determined
|
|
||||||
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
|
|
||||||
}
|
|
||||||
define service{
|
|
||||||
use generic-service ;Use generic-service template
|
|
||||||
hostgroup_name linux-servers ; S'applique au groupe en question
|
|
||||||
service_description chk-lin-load ; Nom du service
|
|
||||||
check_command check_lin_load!public!--v2c!netsl!3,2,2!5,4,2 ; Command
|
|
||||||
# servicegroups ser-lin-base ;Service belong servicegroup
|
|
||||||
}
|
|
||||||
|
|
@ -1,112 +0,0 @@
|
|||||||
###############################################################################
|
|
||||||
# TIMEPERIODS.CFG - SAMPLE TIMEPERIOD DEFINITIONS
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# NOTES: This config file provides you with some example timeperiod definitions
|
|
||||||
# that you can reference in host, service, contact, and dependency
|
|
||||||
# definitions.
|
|
||||||
#
|
|
||||||
# You don't need to keep timeperiods in a separate file from your other
|
|
||||||
# object definitions. This has been done just to make things easier to
|
|
||||||
# understand.
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
#
|
|
||||||
# TIMEPERIOD DEFINITIONS
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
# This defines a timeperiod where all times are valid for checks,
|
|
||||||
# notifications, etc. The classic "24x7" support nightmare. :-)
|
|
||||||
|
|
||||||
define timeperiod {
|
|
||||||
|
|
||||||
name 24x7
|
|
||||||
timeperiod_name 24x7
|
|
||||||
alias 24 Hours A Day, 7 Days A Week
|
|
||||||
|
|
||||||
sunday 00:00-24:00
|
|
||||||
monday 00:00-24:00
|
|
||||||
tuesday 00:00-24:00
|
|
||||||
wednesday 00:00-24:00
|
|
||||||
thursday 00:00-24:00
|
|
||||||
friday 00:00-24:00
|
|
||||||
saturday 00:00-24:00
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# This defines a timeperiod that is normal workhours for
|
|
||||||
# those of us monitoring networks and such in the U.S.
|
|
||||||
|
|
||||||
define timeperiod {
|
|
||||||
|
|
||||||
name workhours
|
|
||||||
timeperiod_name workhours
|
|
||||||
alias Normal Work Hours
|
|
||||||
|
|
||||||
monday 09:00-17:00
|
|
||||||
tuesday 09:00-17:00
|
|
||||||
wednesday 09:00-17:00
|
|
||||||
thursday 09:00-17:00
|
|
||||||
friday 09:00-17:00
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# This defines the *perfect* check and notification
|
|
||||||
# timeperiod
|
|
||||||
|
|
||||||
define timeperiod {
|
|
||||||
|
|
||||||
name none
|
|
||||||
timeperiod_name none
|
|
||||||
alias No Time Is A Good Time
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Some U.S. holidays
|
|
||||||
# Note: The timeranges for each holiday are meant to *exclude* the holidays from being
|
|
||||||
# treated as a valid time for notifications, etc. You probably don't want your pager
|
|
||||||
# going off on New Year's. Although your employer might... :-)
|
|
||||||
|
|
||||||
define timeperiod {
|
|
||||||
|
|
||||||
name us-holidays
|
|
||||||
timeperiod_name us-holidays
|
|
||||||
alias U.S. Holidays
|
|
||||||
|
|
||||||
january 1 00:00-00:00 ; New Years
|
|
||||||
monday -1 may 00:00-00:00 ; Memorial Day (last Monday in May)
|
|
||||||
july 4 00:00-00:00 ; Independence Day
|
|
||||||
monday 1 september 00:00-00:00 ; Labor Day (first Monday in September)
|
|
||||||
thursday 4 november 00:00-00:00 ; Thanksgiving (4th Thursday in November)
|
|
||||||
december 25 00:00-00:00 ; Christmas
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# This defines a modified "24x7" timeperiod that covers every day of the
|
|
||||||
# year, except for U.S. holidays (defined in the timeperiod above).
|
|
||||||
|
|
||||||
define timeperiod {
|
|
||||||
|
|
||||||
name 24x7_sans_holidays
|
|
||||||
timeperiod_name 24x7_sans_holidays
|
|
||||||
alias 24x7 Sans Holidays
|
|
||||||
|
|
||||||
use us-holidays ; Get holiday exceptions from other timeperiod
|
|
||||||
|
|
||||||
sunday 00:00-24:00
|
|
||||||
monday 00:00-24:00
|
|
||||||
tuesday 00:00-24:00
|
|
||||||
wednesday 00:00-24:00
|
|
||||||
thursday 00:00-24:00
|
|
||||||
friday 00:00-24:00
|
|
||||||
saturday 00:00-24:00
|
|
||||||
}
|
|
@ -1,136 +0,0 @@
|
|||||||
###############################################################################
|
|
||||||
# WINDOWS.CFG - SAMPLE CONFIG FILE FOR MONITORING A WINDOWS MACHINE
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# NOTES: This config file assumes that you are using the sample configuration
|
|
||||||
# files that get installed with the Nagios quickstart guide.
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
#
|
|
||||||
# HOST DEFINITIONS
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
define host {
|
|
||||||
use windows-servers
|
|
||||||
host_name srvwin
|
|
||||||
alias Windows Servers
|
|
||||||
address 192.168.0.21
|
|
||||||
}
|
|
||||||
|
|
||||||
# Define a host for the Windows machine we'll be monitoring
|
|
||||||
# Change the host_name, alias, and address to fit your situation
|
|
||||||
|
|
||||||
# GROUP DEFINITIONS
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
# Define a hostgroup for Windows machines
|
|
||||||
# All hosts that use the windows-server template will automatically be a member of this group
|
|
||||||
|
|
||||||
define hostgroup {
|
|
||||||
|
|
||||||
|
|
||||||
hostgroup_name windows-servers ; The name of the hostgroup
|
|
||||||
alias Windows Servers ; Long name of the group
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
#
|
|
||||||
# SERVICE DEFINITIONS
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
# Create a service for monitoring the version of NSCLient++ that is installed
|
|
||||||
# Change the host_name to match the name of the host you defined above
|
|
||||||
|
|
||||||
define service {
|
|
||||||
|
|
||||||
use generic-service
|
|
||||||
host_name winserver
|
|
||||||
service_description NSClient++ Version
|
|
||||||
check_command check_nt!CLIENTVERSION
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Create a service for monitoring the uptime of the server
|
|
||||||
# Change the host_name to match the name of the host you defined above
|
|
||||||
|
|
||||||
define service {
|
|
||||||
|
|
||||||
use generic-service
|
|
||||||
host_name winserver
|
|
||||||
service_description Uptime
|
|
||||||
check_command check_nt!UPTIME
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Create a service for monitoring CPU load
|
|
||||||
# Change the host_name to match the name of the host you defined above
|
|
||||||
|
|
||||||
define service {
|
|
||||||
|
|
||||||
use generic-service
|
|
||||||
host_name winserver
|
|
||||||
service_description CPU Load
|
|
||||||
check_command check_nt!CPULOAD!-l 5,80,90
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Create a service for monitoring memory usage
|
|
||||||
# Change the host_name to match the name of the host you defined above
|
|
||||||
|
|
||||||
define service {
|
|
||||||
|
|
||||||
use generic-service
|
|
||||||
host_name winserver
|
|
||||||
service_description Memory Usage
|
|
||||||
check_command check_nt!MEMUSE!-w 80 -c 90
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Create a service for monitoring C:\ disk usage
|
|
||||||
# Change the host_name to match the name of the host you defined above
|
|
||||||
|
|
||||||
define service {
|
|
||||||
|
|
||||||
use generic-service
|
|
||||||
host_name winserver
|
|
||||||
service_description C:\ Drive Space
|
|
||||||
check_command check_nt!USEDDISKSPACE!-l c -w 80 -c 90
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Create a service for monitoring the W3SVC service
|
|
||||||
# Change the host_name to match the name of the host you defined above
|
|
||||||
|
|
||||||
define service {
|
|
||||||
|
|
||||||
use generic-service
|
|
||||||
host_name winserver
|
|
||||||
service_description W3SVC
|
|
||||||
check_command check_nt!SERVICESTATE!-d SHOWALL -l W3SVC
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Create a service for monitoring the Explorer.exe process
|
|
||||||
# Change the host_name to match the name of the host you defined above
|
|
||||||
|
|
||||||
define service {
|
|
||||||
|
|
||||||
use generic-service
|
|
||||||
host_name winserver
|
|
||||||
service_description Explorer
|
|
||||||
check_command check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe
|
|
||||||
}
|
|
@ -1,49 +0,0 @@
|
|||||||
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
|
|
||||||
|
|
||||||
|
|
||||||
# Debian specific: Specifying a file name will cause the first
|
|
||||||
# line of that file to be used as the name. The Debian default
|
|
||||||
# is /etc/mailname.
|
|
||||||
#myorigin = /etc/mailname
|
|
||||||
|
|
||||||
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
|
|
||||||
biff = no
|
|
||||||
|
|
||||||
# appending .domain is the MUA's job.
|
|
||||||
append_dot_mydomain = no
|
|
||||||
|
|
||||||
# Uncomment the next line to generate "delayed mail" warnings
|
|
||||||
#delay_warning_time = 4h
|
|
||||||
|
|
||||||
readme_directory = no
|
|
||||||
|
|
||||||
# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
|
|
||||||
# fresh installs.
|
|
||||||
compatibility_level = 2
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# TLS parameters
|
|
||||||
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
|
|
||||||
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
|
|
||||||
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
|
|
||||||
smtpd_tls_security_level=may
|
|
||||||
smtp_sasl_auth_enable = yes
|
|
||||||
smtp_sasl_security_options = noanonymous
|
|
||||||
smtp_tls_CApath=/etc/ssl/certs
|
|
||||||
smtp_tls_security_level=encrypt
|
|
||||||
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
|
|
||||||
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
|
|
||||||
|
|
||||||
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
|
|
||||||
myhostname = nagios.sio.lan
|
|
||||||
alias_maps = hash:/etc/aliases
|
|
||||||
alias_database = hash:/etc/aliases
|
|
||||||
mydestination = $myhostname, nagios, localhost.localdomain, , localhost
|
|
||||||
relayhost = [smtp.gmail.com]:587
|
|
||||||
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
|
|
||||||
mailbox_size_limit = 0
|
|
||||||
recipient_delimiter = +
|
|
||||||
inet_interfaces = all
|
|
||||||
inet_protocols = ipv4
|
|
||||||
|
|
@ -1 +0,0 @@
|
|||||||
[smtp.gmail.com]:587 supervisionraphanaud@gmail.com:Azertyuiop1+
|
|
@ -1,163 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# FOG is a computer imaging solution.
|
|
||||||
# Copyright (C) 2007 Chuck Syperski & Jian Zhang
|
|
||||||
#
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
|
||||||
[[ -z $repo ]] && repo="php"
|
|
||||||
[[ -z $packageQuery ]] && packageQuery="dpkg -l \$x | grep '^ii'"
|
|
||||||
if [[ $linuxReleaseName == +(*[Bb][Ii][Aa][Nn]*) ]]; then
|
|
||||||
sysvrcconf="sysv-rc-conf"
|
|
||||||
case $OSVersion in
|
|
||||||
8)
|
|
||||||
php_ver="5"
|
|
||||||
;;
|
|
||||||
9)
|
|
||||||
php_ver="7.0"
|
|
||||||
x="*php5*"
|
|
||||||
;;
|
|
||||||
10)
|
|
||||||
php_ver="7.3"
|
|
||||||
x="*php5* *php7.0*"
|
|
||||||
;;
|
|
||||||
11)
|
|
||||||
php_ver="7.4"
|
|
||||||
x="*php5* *php7.0*"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
old_php=$(eval $packageQuery 2>/dev/null | awk '{print $2}' | tr '\n' ' ')
|
|
||||||
if [[ -n "$old_php" ]]; then
|
|
||||||
dots "Removing old PHP version before installing the new one"
|
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get purge -yq ${old_php} >/dev/null 2>&1
|
|
||||||
[[ $? -ne 0 ]] && echo "Failed" || echo "Done"
|
|
||||||
apt-get clean -yq >/dev/null 2>&1
|
|
||||||
fi
|
|
||||||
elif [[ $linuxReleaseName == +(*[Uu][Bb][Uu][Nn][Tt][Uu]*|*[Mm][Ii][Nn][Tt]*) ]]; then
|
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get purge -yq sysv-rc-conf >/dev/null 2>&1
|
|
||||||
case $OSVersion in
|
|
||||||
20)
|
|
||||||
php_ver="7.4"
|
|
||||||
;;
|
|
||||||
19)
|
|
||||||
php_ver="7.3"
|
|
||||||
;;
|
|
||||||
18)
|
|
||||||
php_ver="7.2"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
sysvrcconf="sysv-rc-conf"
|
|
||||||
php_ver="7.1"
|
|
||||||
x="*php5* *php-5*"
|
|
||||||
eval $packageQuery >>$workingdir/error_logs/fog_error_${version}.log 2>&1
|
|
||||||
if [[ $? -ne 0 ]]; then
|
|
||||||
if [[ $autoaccept != yes ]]; then
|
|
||||||
echo " *** Detected a potential need to reinstall apache and php files."
|
|
||||||
echo " *** This will remove the /etc/php* and /etc/apache2* directories"
|
|
||||||
echo " *** and remove/purge the apache and php files from this system."
|
|
||||||
echo " *** If you're okay with this please type Y, anything else will"
|
|
||||||
echo " *** continue the installation, but may mean you will need to"
|
|
||||||
echo " *** remove the files later and make proper changes as "
|
|
||||||
echo " *** necessary. (Y/N): "
|
|
||||||
read dummy
|
|
||||||
else
|
|
||||||
dummy="y"
|
|
||||||
fi
|
|
||||||
case $dummy in
|
|
||||||
[Yy])
|
|
||||||
dots "Removing apache and php files"
|
|
||||||
rm -rf /etc/php* /etc/apache2*
|
|
||||||
echo "Done"
|
|
||||||
dots "Stopping web services"
|
|
||||||
if [[ $systemctl == yes ]]; then
|
|
||||||
systemctl is-active --quiet apache2 && systemctl stop apache2 >/dev/null 2>&1 || true
|
|
||||||
fi
|
|
||||||
[[ ! $? -eq 0 ]] && echo "Failed" || echo "Done"
|
|
||||||
dots "Removing the apache and php packages"
|
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get purge -yq 'apache2*' 'php5*' 'php7*' 'libapache*' >/dev/null 2>&1
|
|
||||||
[[ ! $? -eq 0 ]] && echo "Failed" || echo "Done"
|
|
||||||
apt-get clean -yq >/dev/null 2>&1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
esac
|
|
||||||
else
|
|
||||||
[[ -z $php_ver ]] && php_ver=5
|
|
||||||
fi
|
|
||||||
[[ -z $php_verAdds ]] && php_verAdds="-${php_ver}"
|
|
||||||
[[ $php_ver == 5 ]] && php_verAdds="-5.6"
|
|
||||||
[[ $php_ver != 5 ]] && phpcmd="php" || phpcmd="php5"
|
|
||||||
[[ -z $phpfpm ]] && phpfpm="php${php_ver}-fpm"
|
|
||||||
[[ -z $phpldap ]] && phpldap="php${php_ver}-ldap"
|
|
||||||
[[ -z $phpcmd ]] && phpcmd="php"
|
|
||||||
case $linuxReleaseName in
|
|
||||||
*[Uu][Bb][Uu][Nn][Tt][Uu]*|*[Bb][Ii][Aa][Nn]*|*[Mm][Ii][Nn][Tt]*)
|
|
||||||
if [[ -z $packages ]]; then
|
|
||||||
x="mysql-server"
|
|
||||||
eval $packageQuery >>$workingdir/error_logs/fog_error_${version}.log 2>&1
|
|
||||||
[[ $? -eq 0 ]] && db_packages="mysql-client mysql-server" || db_packages="mariadb-client mariadb-server"
|
|
||||||
packages="apache2 build-essential cpp curl g++ gawk gcc genisoimage git gzip htmldoc isc-dhcp-server isolinux lftp libapache2-mod-fastcgi libapache2-mod-php${php_ver} libc6 libcurl3 liblzma-dev m4 ${db_packages} net-tools nfs-kernel-server openssh-server $phpfpm php-php-gettext php${php_ver} php${php_ver}-cli php${php_ver}-curl php${php_ver}-gd php${php_ver}-json $phpldap php${php_ver}-mysql php${php_ver}-mysqlnd ${sysvrcconf} tar tftpd-hpa tftp-hpa vsftpd wget xinetd zlib1g"
|
|
||||||
else
|
|
||||||
# make sure we update all the php version numbers with those specified above
|
|
||||||
packages=${packages//php[0-9]\.[0-9]/php${php_ver}}
|
|
||||||
fi
|
|
||||||
[[ -z $packageinstaller ]] && packageinstaller="apt-get -yq install -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold"
|
|
||||||
[[ -z $packagelist ]] && packagelist="apt-cache pkgnames | grep"
|
|
||||||
[[ -z $packageupdater ]] && packageupdater="apt-get -yq upgrade -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold"
|
|
||||||
[[ -z $packmanUpdate ]] && packmanUpdate="apt-get update"
|
|
||||||
[[ -z $dhcpname ]] && dhcpname="isc-dhcp-server"
|
|
||||||
[[ -z $olddhcpname ]] && olddhcpname="dhcp3-server"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
[[ -z $langPackages ]] && langPackages="language-pack-it language-pack-en language-pack-es language-pack-zh-hans"
|
|
||||||
[[ $php_ver != 5 ]] && packages="$packages php${php_ver}-mbstring"
|
|
||||||
if [[ -z $webdirdest ]]; then
|
|
||||||
if [[ -z $docroot ]]; then
|
|
||||||
docroot="/var/www/html/"
|
|
||||||
webdirdest="${docroot}fog/"
|
|
||||||
elif [[ "$docroot" != *'fog'* ]]; then
|
|
||||||
webdirdest="${docroot}fog/"
|
|
||||||
else
|
|
||||||
webdirdest="${docroot}/"
|
|
||||||
fi
|
|
||||||
if [[ $docroot == /var/www/html/ && ! -d $docroot ]]; then
|
|
||||||
docroot="/var/www/"
|
|
||||||
webdirdest="${docroot}fog/"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
[[ -z $webredirect ]] && webredirect="$docroot/index.php"
|
|
||||||
[[ -z $apacheuser ]] && apacheuser="www-data"
|
|
||||||
[[ -z $apachelogdir ]] && apachelogdir="/var/log/apache2"
|
|
||||||
[[ -z $apacheerrlog ]] && apacheerrlog="$apachelogdir/error.log"
|
|
||||||
[[ -z $apacheacclog ]] && apacheacclog="$apachelogdir/access.log"
|
|
||||||
[[ -z $etcconf ]] && etcconf="/etc/apache2/sites-available/001-fog.conf"
|
|
||||||
[[ $php_ver != 5 ]] && phpini="/etc/$phpcmd/$php_ver/fpm/php.ini" || phpini="/etc/$phpcmd/fpm/php.ini"
|
|
||||||
[[ -z $storageLocation ]] && storageLocation="/images"
|
|
||||||
[[ -z $storageLocationCapture ]] && storageLocationCapture="${storageLocation}/dev"
|
|
||||||
[[ -z $dhcpconfig ]] && dhcpconfig="/etc/dhcp3/dhcpd.conf"
|
|
||||||
[[ -z $dhcpconfigother ]] && dhcpconfigother="/etc/dhcp/dhcpd.conf"
|
|
||||||
[[ -z $tftpdirdst ]] && tftpdirdst="/tftpboot"
|
|
||||||
[[ -z $tftpconfig ]] && tftpconfig="/etc/xinetd.d/tftp"
|
|
||||||
[[ -z $tftpconfigupstartconf ]] && tftpconfigupstartconf="/etc/init/tftpd-hpa.conf"
|
|
||||||
[[ -z $tftpconfigupstartdefaults ]] && tftpconfigupstartdefaults="/etc/default/tftpd-hpa"
|
|
||||||
[[ -z $ftpconfig ]] && ftpconfig="/etc/vsftpd.conf"
|
|
||||||
[[ -z $snapindir ]] && snapindir="/opt/fog/snapins"
|
|
||||||
[[ -z $jsontest ]] && jsontest="php${php_ver}-json php${php_ver}-common"
|
|
||||||
if [[ -z $dhcpd ]]; then
|
|
||||||
if [[ -e /etc/init.d/$dhcpname ]]; then
|
|
||||||
dhcpd=$dhcpname
|
|
||||||
elif [[ -e /etc/init.d/$olddhcpname ]]; then
|
|
||||||
dhcpd=$olddhcpname
|
|
||||||
fi
|
|
||||||
fi
|
|
@ -1,137 +0,0 @@
|
|||||||
<IfModule mod_ssl.c>
|
|
||||||
<VirtualHost _default_:443>
|
|
||||||
ServerAdmin webmaster@localhost
|
|
||||||
#ServerName wordpress
|
|
||||||
DocumentRoot /var/www/html/
|
|
||||||
|
|
||||||
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
|
|
||||||
# error, crit, alert, emerg.
|
|
||||||
# It is also possible to configure the loglevel for particular
|
|
||||||
# modules, e.g.
|
|
||||||
#LogLevel info ssl:warn
|
|
||||||
|
|
||||||
ErrorLog ${APACHE_LOG_DIR}/error.log
|
|
||||||
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
|
||||||
|
|
||||||
# For most configuration files from conf-available/, which are
|
|
||||||
# enabled or disabled at a global level, it is possible to
|
|
||||||
# include a line for only one particular virtual host. For example the
|
|
||||||
# following line enables the CGI configuration for this host only
|
|
||||||
# after it has been globally disabled with "a2disconf".
|
|
||||||
#Include conf-available/serve-cgi-bin.conf
|
|
||||||
|
|
||||||
# SSL Engine Switch:
|
|
||||||
# Enable/Disable SSL for this virtual host.
|
|
||||||
SSLEngine on
|
|
||||||
|
|
||||||
# A self-signed (snakeoil) certificate can be created by installing
|
|
||||||
# the ssl-cert package. See
|
|
||||||
# /usr/share/doc/apache2/README.Debian.gz for more info.
|
|
||||||
# If both key and certificate are stored in the same file, only the
|
|
||||||
# SSLCertificateFile directive is needed.
|
|
||||||
SSLCertificateFile /etc/apache2/server.crt
|
|
||||||
SSLCertificateKeyFile /etc/apache2/server.key
|
|
||||||
|
|
||||||
#SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
|
|
||||||
#SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
|
|
||||||
|
|
||||||
# Server Certificate Chain:
|
|
||||||
# Point SSLCertificateChainFile at a file containing the
|
|
||||||
# concatenation of PEM encoded CA certificates which form the
|
|
||||||
# certificate chain for the server certificate. Alternatively
|
|
||||||
# the referenced file can be the same as SSLCertificateFile
|
|
||||||
# when the CA certificates are directly appended to the server
|
|
||||||
# certificate for convinience.
|
|
||||||
#SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt
|
|
||||||
|
|
||||||
# Certificate Authority (CA):
|
|
||||||
# Set the CA certificate verification path where to find CA
|
|
||||||
# certificates for client authentication or alternatively one
|
|
||||||
# huge file containing all of them (file must be PEM encoded)
|
|
||||||
# Note: Inside SSLCACertificatePath you need hash symlinks
|
|
||||||
# to point to the certificate files. Use the provided
|
|
||||||
# Makefile to update the hash symlinks after changes.
|
|
||||||
#SSLCACertificatePath /etc/ssl/certs/
|
|
||||||
#SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt
|
|
||||||
|
|
||||||
# Certificate Revocation Lists (CRL):
|
|
||||||
# Set the CA revocation path where to find CA CRLs for client
|
|
||||||
# authentication or alternatively one huge file containing all
|
|
||||||
# of them (file must be PEM encoded)
|
|
||||||
# Note: Inside SSLCARevocationPath you need hash symlinks
|
|
||||||
# to point to the certificate files. Use the provided
|
|
||||||
# Makefile to update the hash symlinks after changes.
|
|
||||||
#SSLCARevocationPath /etc/apache2/ssl.crl/
|
|
||||||
#SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl
|
|
||||||
|
|
||||||
# Client Authentication (Type):
|
|
||||||
# Client certificate verification type and depth. Types are
|
|
||||||
# none, optional, require and optional_no_ca. Depth is a
|
|
||||||
# number which specifies how deeply to verify the certificate
|
|
||||||
# issuer chain before deciding the certificate is not valid.
|
|
||||||
#SSLVerifyClient require
|
|
||||||
#SSLVerifyDepth 10
|
|
||||||
|
|
||||||
# SSL Engine Options:
|
|
||||||
# Set various options for the SSL engine.
|
|
||||||
# o FakeBasicAuth:
|
|
||||||
# Translate the client X.509 into a Basic Authorisation. This means that
|
|
||||||
# the standard Auth/DBMAuth methods can be used for access control. The
|
|
||||||
# user name is the `one line' version of the client's X.509 certificate.
|
|
||||||
# Note that no password is obtained from the user. Every entry in the user
|
|
||||||
# file needs this password: `xxj31ZMTZzkVA'.
|
|
||||||
# o ExportCertData:
|
|
||||||
# This exports two additional environment variables: SSL_CLIENT_CERT and
|
|
||||||
# SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
|
|
||||||
# server (always existing) and the client (only existing when client
|
|
||||||
# authentication is used). This can be used to import the certificates
|
|
||||||
# into CGI scripts.
|
|
||||||
# o StdEnvVars:
|
|
||||||
# This exports the standard SSL/TLS related `SSL_*' environment variables.
|
|
||||||
# Per default this exportation is switched off for performance reasons,
|
|
||||||
# because the extraction step is an expensive operation and is usually
|
|
||||||
# useless for serving static content. So one usually enables the
|
|
||||||
# exportation for CGI and SSI requests only.
|
|
||||||
# o OptRenegotiate:
|
|
||||||
# This enables optimized SSL connection renegotiation handling when SSL
|
|
||||||
# directives are used in per-directory context.
|
|
||||||
#SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
|
|
||||||
<FilesMatch "\.(cgi|shtml|phtml|php)$">
|
|
||||||
SSLOptions +StdEnvVars
|
|
||||||
</FilesMatch>
|
|
||||||
<Directory /usr/lib/cgi-bin>
|
|
||||||
SSLOptions +StdEnvVars
|
|
||||||
</Directory>
|
|
||||||
|
|
||||||
# SSL Protocol Adjustments:
|
|
||||||
# The safe and default but still SSL/TLS standard compliant shutdown
|
|
||||||
# approach is that mod_ssl sends the close notify alert but doesn't wait for
|
|
||||||
# the close notify alert from client. When you need a different shutdown
|
|
||||||
# approach you can use one of the following variables:
|
|
||||||
# o ssl-unclean-shutdown:
|
|
||||||
# This forces an unclean shutdown when the connection is closed, i.e. no
|
|
||||||
# SSL close notify alert is send or allowed to received. This violates
|
|
||||||
# the SSL/TLS standard but is needed for some brain-dead browsers. Use
|
|
||||||
# this when you receive I/O errors because of the standard approach where
|
|
||||||
# mod_ssl sends the close notify alert.
|
|
||||||
# o ssl-accurate-shutdown:
|
|
||||||
# This forces an accurate shutdown when the connection is closed, i.e. a
|
|
||||||
# SSL close notify alert is send and mod_ssl waits for the close notify
|
|
||||||
# alert of the client. This is 100% SSL/TLS standard compliant, but in
|
|
||||||
# practice often causes hanging connections with brain-dead browsers. Use
|
|
||||||
# this only for browsers where you know that their SSL implementation
|
|
||||||
# works correctly.
|
|
||||||
# Notice: Most problems of broken clients are also related to the HTTP
|
|
||||||
# keep-alive facility, so you usually additionally want to disable
|
|
||||||
# keep-alive for those clients, too. Use variable "nokeepalive" for this.
|
|
||||||
# Similarly, one has to force some clients to use HTTP/1.0 to workaround
|
|
||||||
# their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
|
|
||||||
# "force-response-1.0" for this.
|
|
||||||
# BrowserMatch "MSIE [2-6]" \
|
|
||||||
# nokeepalive ssl-unclean-shutdown \
|
|
||||||
# downgrade-1.0 force-response-1.0
|
|
||||||
|
|
||||||
</VirtualHost>
|
|
||||||
</IfModule>
|
|
||||||
|
|
||||||
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
|
|
@ -1,23 +0,0 @@
|
|||||||
#<VirtualHost *:80>
|
|
||||||
# ServerName wordpress
|
|
||||||
# redirect permanent / https://192.168.0.34/wordpress
|
|
||||||
# DocumentRoot /var/www/wordpress
|
|
||||||
|
|
||||||
|
|
||||||
# <Directory /var/www/wordpress/>
|
|
||||||
# AllowOverride All
|
|
||||||
# </Directory>
|
|
||||||
|
|
||||||
|
|
||||||
#</VirtualHost>
|
|
||||||
<VirtualHost *:80>
|
|
||||||
ServerName wordpress
|
|
||||||
DocumentRoot /var/www/html/
|
|
||||||
<Directory /var/www/html/>
|
|
||||||
AllowOverride all
|
|
||||||
Require all granted
|
|
||||||
</Directory>
|
|
||||||
ErrorLog /var/log/apache2/error.wordpress.log
|
|
||||||
CustomLog /var/log/apache2/access.wordpress.log combined
|
|
||||||
redirect permanent / https://192.168.0.34/
|
|
||||||
</VirtualHost>
|
|
@ -1,98 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* La configuration de base de votre installation WordPress.
|
|
||||||
*
|
|
||||||
* Ce fichier est utilisé par le script de création de wp-config.php pendant
|
|
||||||
* le processus d’installation. Vous n’avez pas à utiliser le site web, vous
|
|
||||||
* pouvez simplement renommer ce fichier en « wp-config.php » et remplir les
|
|
||||||
* valeurs.
|
|
||||||
*
|
|
||||||
* Ce fichier contient les réglages de configuration suivants :
|
|
||||||
*
|
|
||||||
* Réglages MySQL
|
|
||||||
* Préfixe de table
|
|
||||||
* Clés secrètes
|
|
||||||
* Langue utilisée
|
|
||||||
* ABSPATH
|
|
||||||
*
|
|
||||||
* @link https://fr.wordpress.org/support/article/editing-wp-config-php/.
|
|
||||||
*
|
|
||||||
* @package WordPress
|
|
||||||
*/
|
|
||||||
|
|
||||||
// ** Réglages MySQL - Votre hébergeur doit vous fournir ces informations. ** //
|
|
||||||
/** Nom de la base de données de WordPress. */
|
|
||||||
define( 'DB_NAME', 'wordpress' );
|
|
||||||
|
|
||||||
/** Utilisateur de la base de données MySQL. */
|
|
||||||
define( 'DB_USER', 'wordpress_user' );
|
|
||||||
|
|
||||||
/** Mot de passe de la base de données MySQL. */
|
|
||||||
define( 'DB_PASSWORD', 'qdrhh45' );
|
|
||||||
|
|
||||||
/** Adresse de l’hébergement MySQL. */
|
|
||||||
define( 'DB_HOST', 'localhost' );
|
|
||||||
|
|
||||||
/** Jeu de caractères à utiliser par la base de données lors de la création des tables. */
|
|
||||||
define( 'DB_CHARSET', 'utf8' );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Type de collation de la base de données.
|
|
||||||
* N’y touchez que si vous savez ce que vous faites.
|
|
||||||
*/
|
|
||||||
define( 'DB_COLLATE', '' );
|
|
||||||
|
|
||||||
/**#@+
|
|
||||||
* Clés uniques d’authentification et salage.
|
|
||||||
*
|
|
||||||
* Remplacez les valeurs par défaut par des phrases uniques !
|
|
||||||
* Vous pouvez générer des phrases aléatoires en utilisant
|
|
||||||
* {@link https://api.wordpress.org/secret-key/1.1/salt/ le service de clés secrètes de WordPress.org}.
|
|
||||||
* Vous pouvez modifier ces phrases à n’importe quel moment, afin d’invalider tous les cookies existants.
|
|
||||||
* Cela forcera également tous les utilisateurs à se reconnecter.
|
|
||||||
*
|
|
||||||
* @since 2.6.0
|
|
||||||
*/
|
|
||||||
define( 'AUTH_KEY', 'mettez une phrase unique ici' );
|
|
||||||
define( 'SECURE_AUTH_KEY', 'mettez une phrase unique ici' );
|
|
||||||
define( 'LOGGED_IN_KEY', 'mettez une phrase unique ici' );
|
|
||||||
define( 'NONCE_KEY', 'mettez une phrase unique ici' );
|
|
||||||
define( 'AUTH_SALT', 'mettez une phrase unique ici' );
|
|
||||||
define( 'SECURE_AUTH_SALT', 'mettez une phrase unique ici' );
|
|
||||||
define( 'LOGGED_IN_SALT', 'mettez une phrase unique ici' );
|
|
||||||
define( 'NONCE_SALT', 'mettez une phrase unique ici' );
|
|
||||||
/**#@-*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Préfixe de base de données pour les tables de WordPress.
|
|
||||||
*
|
|
||||||
* Vous pouvez installer plusieurs WordPress sur une seule base de données
|
|
||||||
* si vous leur donnez chacune un préfixe unique.
|
|
||||||
* N’utilisez que des chiffres, des lettres non-accentuées, et des caractères soulignés !
|
|
||||||
*/
|
|
||||||
$table_prefix = 'wp_';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Pour les développeurs : le mode déboguage de WordPress.
|
|
||||||
*
|
|
||||||
* En passant la valeur suivante à "true", vous activez l’affichage des
|
|
||||||
* notifications d’erreurs pendant vos essais.
|
|
||||||
* Il est fortement recommandé que les développeurs d’extensions et
|
|
||||||
* de thèmes se servent de WP_DEBUG dans leur environnement de
|
|
||||||
* développement.
|
|
||||||
*
|
|
||||||
* Pour plus d’information sur les autres constantes qui peuvent être utilisées
|
|
||||||
* pour le déboguage, rendez-vous sur le Codex.
|
|
||||||
*
|
|
||||||
* @link https://fr.wordpress.org/support/article/debugging-in-wordpress/
|
|
||||||
*/
|
|
||||||
define( 'WP_DEBUG', false );
|
|
||||||
|
|
||||||
/* C’est tout, ne touchez pas à ce qui suit ! Bonne publication. */
|
|
||||||
|
|
||||||
/** Chemin absolu vers le dossier de WordPress. */
|
|
||||||
if ( ! defined( 'ABSPATH' ) )
|
|
||||||
define( 'ABSPATH', dirname( __FILE__ ) . '/' );
|
|
||||||
|
|
||||||
/** Réglage des variables de WordPress et de ses fichiers inclus. */
|
|
||||||
require_once( ABSPATH . 'wp-settings.php' );
|
|
@ -1,10 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -o errexit
|
|
||||||
set -o nounset
|
|
||||||
fich='user.txt'
|
|
||||||
while read ligne
|
|
||||||
do
|
|
||||||
echo "${ligne}"
|
|
||||||
done < "${fich}"
|
|
||||||
exit 0
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -o errexit
|
|
||||||
set -o nounset
|
|
||||||
if [[ $# != 1 ]]; then
|
|
||||||
echo "usage : $0 <fichier>"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fich="$1"
|
|
||||||
while read ligne
|
|
||||||
do
|
|
||||||
echo "${ligne}"
|
|
||||||
done < "${fich}"
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -o errexit
|
|
||||||
set -o nounset
|
|
||||||
if [[ $# != 1 ]]; then
|
|
||||||
echo "usage : $0 <fichier>"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fich="$1"
|
|
||||||
if ! [[ -r "${fich}" ]]; then
|
|
||||||
echo "$0 : erreur ouverture fichier ${fich}"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
while read ligne
|
|
||||||
do
|
|
||||||
echo "${ligne}"
|
|
||||||
done < "${fich}"
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -o errexit
|
|
||||||
set -o nounset
|
|
||||||
if [[ $# != 1 ]]; then
|
|
||||||
echo "usage : $0 <fichier>"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fich="$1"
|
|
||||||
if ! [[ -r "${fich}" ]]; then
|
|
||||||
echo "$0 : erreur ouverture fichier ${fich}"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
while read ligne
|
|
||||||
do
|
|
||||||
login=$(echo "${ligne}" |cut -f1 -d':')
|
|
||||||
nom=$(echo "${ligne}" |cut -f2 -d':')
|
|
||||||
echo "$login"
|
|
||||||
echo "$nom"
|
|
||||||
done < "${fich}"
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#set -o errexit
|
|
||||||
set -o nounset
|
|
||||||
if [[ $# != 1 ]]; then
|
|
||||||
echo "usage : $0 <fichier>"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fich="$1"
|
|
||||||
if ! [[ -r "${fich}" ]]; then
|
|
||||||
echo "$0 : erreur ouverture fichier ${fich}"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
while read ligne
|
|
||||||
do
|
|
||||||
login=$(echo "${ligne}" |cut -f1 -d':')
|
|
||||||
nom=$(echo "${ligne}" |cut -f2 -d':')
|
|
||||||
getent passwd "${login}" >> /dev/null
|
|
||||||
if [[ $? != 0 ]] ; then
|
|
||||||
useradd -m -d /home/${login} -c "${nom}" -s /bin/bash ${login}
|
|
||||||
|
|
||||||
else
|
|
||||||
echo "utilisateur ${login} existant"
|
|
||||||
fi
|
|
||||||
done < "${fich}"
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#set -o errexit
|
|
||||||
set -o nounset
|
|
||||||
PATH=${PATH}:/usr/sbin
|
|
||||||
if [[ $# != 1 ]]; then
|
|
||||||
echo "usage : $0 <fichier>"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fich="$1"
|
|
||||||
if ! [[ -r "${fich}" ]]; then
|
|
||||||
echo "$0 : erreur ouverture fichier ${fich}"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
while read ligne
|
|
||||||
do
|
|
||||||
login=$(echo "${ligne}" |cut -f1 -d':')
|
|
||||||
nom=$(echo "${ligne}" |cut -f2 -d':')
|
|
||||||
getent passwd "${login}" >> /dev/null
|
|
||||||
if [[ $? != 0 ]] ; then
|
|
||||||
useradd -m -d /home/${login} -c "${nom}" -s /bin/bash ${login}
|
|
||||||
pw=$(pwgen 4 1)
|
|
||||||
echo "${login}:${pw}"|chpasswd
|
|
||||||
echo "${login}:${pw}" >> "${fich}.pwd"
|
|
||||||
else
|
|
||||||
echo "$0 : utilisateur ${login} existant"
|
|
||||||
fi
|
|
||||||
done < "${fich}"
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
|
|
@ -1 +0,0 @@
|
|||||||
|
|
@ -1,17 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
DAT=$(date "+%u")
|
|
||||||
DEST=/home/sv/d/"${DAT}"
|
|
||||||
HOST=root@192.168.0.29
|
|
||||||
ssh "${HOST}" apt install -y rsync apache2 mariadb-server php
|
|
||||||
ssh "${HOST}" "mysql CREATE DATABASES wordpress;" #a refaire
|
|
||||||
ssh "${HOST}" "mysql -u wordpress_user -pqdrhh45 wordpress < "${DEST}"/wordpress.sql" #a refaire
|
|
||||||
scp -r "${DEST}"/wordpress "${HOST}":/var/www/html/
|
|
||||||
scp "${DEST}"/default-ssl.conf "${HOST}":/etc/apache2/sites-available/
|
|
||||||
scp "${DEST}"/wordpress.conf "${HOST}":/etc/apache2/sites-available/
|
|
||||||
scp "${DEST}"/server.key "${HOST}":/etc/apache2/
|
|
||||||
scp "${DEST}"/server.crt "${HOST}":/etc/apache2/
|
|
||||||
#rsync -az "${DEST}"/wordpress "${HOST}":/var/www/html/
|
|
||||||
#rsync -az "${DEST}"/default-ssl.conf "${HOST}":/etc/apache2/sites-available/
|
|
||||||
#rsync -az "${DEST}"/wordpress.conf "${HOST}":/etc/apache2/sites-available/
|
|
||||||
#rsync -az "${DEST}"/server.key "${HOST}":/etc/apache2/
|
|
||||||
#rsync -az "${DEST}"/server.crt "${HOST}":/etc/apache2/
|
|
@ -1,28 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#set -o errexit
|
|
||||||
set -o nounset
|
|
||||||
if [ $# != 1 ]
|
|
||||||
then
|
|
||||||
echo "usage : $0 <fichier>"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fich="$1"
|
|
||||||
if ! [[ -r "${fich}" ]]; then
|
|
||||||
echo "$0 : erreur ouverture fichier ${fich}"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
while read -r ligne
|
|
||||||
do
|
|
||||||
login=$(echo "${ligne}" |cut -f1 -d':')
|
|
||||||
|
|
||||||
echo "${login}"
|
|
||||||
getent passwd "${login}" >> /dev/null
|
|
||||||
if [[ $? = 0 ]]
|
|
||||||
then
|
|
||||||
userdel -r "${login}"
|
|
||||||
fi
|
|
||||||
done < "${fich}"
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
DAT=$(date "+%u")
|
|
||||||
DEST=/home/sv
|
|
||||||
DEST2="${DEST}/d/${DAT}"
|
|
||||||
[ -d "${DEST}/d" ] || mkdir -p "${DEST}/d"
|
|
||||||
[ -d "${DEST}/d/${DAT}" ] || mkdir -p "${DEST}/d/${DAT}"
|
|
||||||
HOST=sauv@192.168.0.34
|
|
||||||
ssh "${HOST}" "mysqldump -u wordpress_user -pqdrhh45 wordpress|gzip -" >"${DEST2}"/wordpress.sql.gz
|
|
||||||
|
|
||||||
rsync -av -e ssh "${HOST}":/var/www/html/wordpress "${DEST2}"
|
|
||||||
rsync -av -e ssh "${HOST}":/etc/apache2/sites-available/default-ssl.conf "${DEST2}"/default-ssl.conf
|
|
||||||
rsync -av -e ssh "${HOST}":/etc/apache2/sites-available/wordpress.conf "${DEST2}"/wordpress.conf
|
|
||||||
rsync -av -e ssh "${HOST}":/etc/apache2/server.key "${DEST2}"/server.key
|
|
||||||
rsync -av -e ssh "${HOST}":/etc/apache2/server.crt "${DEST2}"/server.crt
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
|||||||
lucien
|
|
||||||
claudine
|
|
||||||
robert
|
|
||||||
marcelle
|
|
@ -1,4 +0,0 @@
|
|||||||
lucien:Lucien Dubois
|
|
||||||
claudine:Claudine Duparc
|
|
||||||
robert:Robert Macaire
|
|
||||||
marcelle:Marcelle Desforets
|
|
@ -1,26 +0,0 @@
|
|||||||
:
|
|
||||||
:
|
|
||||||
:
|
|
||||||
:
|
|
||||||
:
|
|
||||||
:
|
|
||||||
:
|
|
||||||
:
|
|
||||||
:
|
|
||||||
:
|
|
||||||
:
|
|
||||||
:
|
|
||||||
lucien:1XfC
|
|
||||||
claudine:PT2M
|
|
||||||
robert:K4PJ
|
|
||||||
marcelle:i4WH
|
|
||||||
claudine:7Giq
|
|
||||||
robert:VO4u
|
|
||||||
marcelle:3b8S
|
|
||||||
claudine:7qzL
|
|
||||||
robert:NvV6
|
|
||||||
marcelle:7QnY
|
|
||||||
lucien:e5Hz
|
|
||||||
claudine:j9Un
|
|
||||||
robert:ZnJ6
|
|
||||||
marcelle:B7nR
|
|
@ -1,19 +0,0 @@
|
|||||||
#/usr/bin/python3
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
group = {}
|
|
||||||
regexp = '^(\S+) (\S+) (\S+) \[([^]]+)\] "(\w+) (\S+).*" (\d+) (\S+)'
|
|
||||||
for line in sys.stdin:
|
|
||||||
line = line.rstrip ( )
|
|
||||||
match = re.match (regexp, line)
|
|
||||||
if match:
|
|
||||||
print (match.group(1)," ",match.group(8))
|
|
||||||
ip = match.group(1)
|
|
||||||
vol = match.group(8)
|
|
||||||
if ip in group:
|
|
||||||
group[ip] = group[ip] + vol
|
|
||||||
else:
|
|
||||||
group[ip] = vol
|
|
||||||
for key in group.keys():
|
|
||||||
print (key, " ", group[key])
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
|||||||
#!/usr/bin/python3
|
|
||||||
import sys
|
|
||||||
import subprocess
|
|
||||||
import os
|
|
||||||
nbarg = len(sys.argv)
|
|
||||||
if nbarg != 2:
|
|
||||||
print ("Nombre d'argument invalide")
|
|
||||||
exit (1)
|
|
||||||
filename = sys.argv[1]
|
|
||||||
try:
|
|
||||||
fh = open(filename, "r")
|
|
||||||
except:
|
|
||||||
print ("Fichier ", filename," inconnu")
|
|
||||||
exit (2)
|
|
||||||
else:
|
|
||||||
line = fh.readline ()
|
|
||||||
while line:
|
|
||||||
nouvline = line.rstrip()
|
|
||||||
login,nomlong = nouvline.split(':')
|
|
||||||
cmd = "sudo useradd -m -d /home/"+login+" -c \'"+ nomlong+"\' -s /bin/bash "+ login
|
|
||||||
res = os.system ("getent passwd "+login)
|
|
||||||
if res != 0:
|
|
||||||
passw = ["pwgen", "4","1"]
|
|
||||||
os.system (cmd)
|
|
||||||
mdp = subprocess.run(passw,capture_output=True)
|
|
||||||
mdp2 = mdp.stdout.decode("utf-8")
|
|
||||||
mdp3 = mdp2.rstrip()
|
|
||||||
print (mdp3)
|
|
||||||
ch3 = "echo "+login+":"+mdp3+"|sudo chpasswd"
|
|
||||||
print (ch3)
|
|
||||||
os.system (ch3)
|
|
||||||
os.system ("sudo echo "+login+":"+mdp3+" >> "+filename+".pwd")
|
|
||||||
else:
|
|
||||||
print ("Utilisateur "+login+" déjà éxistant")
|
|
||||||
os.system ("sudo userdel -r "+login)
|
|
||||||
line = fh.readline()
|
|
||||||
|
|
||||||
fh.close()
|
|
@ -1,2 +0,0 @@
|
|||||||
adupont:Albert Dupont
|
|
||||||
jduroy:Jeannette Duroy
|
|
@ -1,4 +0,0 @@
|
|||||||
adupont:0PSg
|
|
||||||
jduroy:2Sdc
|
|
||||||
adupont:Ksw4
|
|
||||||
jduroy:C0px
|
|
@ -1,23 +0,0 @@
|
|||||||
config setup
|
|
||||||
charondebug="all"
|
|
||||||
uniqueids=yes
|
|
||||||
strictcrlpolicy=no
|
|
||||||
conn %default
|
|
||||||
conn tunnel #
|
|
||||||
left=10.0.0.2
|
|
||||||
leftsubnet=192.168.2.0/24
|
|
||||||
right=10.0.0.1
|
|
||||||
rightsubnet=192.168.1.0/24
|
|
||||||
ike=aes256-sha2_256-modp1024!
|
|
||||||
esp=aes256-sha2_256!
|
|
||||||
keyingtries=0
|
|
||||||
ikelifetime=1h
|
|
||||||
lifetime=8h
|
|
||||||
dpddelay=30
|
|
||||||
dpdtimeout=120
|
|
||||||
dpdaction=restart
|
|
||||||
authby=secret
|
|
||||||
auto=start
|
|
||||||
keyexchange=ikev2
|
|
||||||
type=tunnel
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
|||||||
# This file holds shared secrets or RSA private keys for authentication.
|
|
||||||
|
|
||||||
# RSA private key for this host, authenticating it to any other host
|
|
||||||
# which knows the public part.
|
|
||||||
10.0.0.2 10.0.0.1 : PSK 'root'
|
|
@ -1 +0,0 @@
|
|||||||
doku
|
|
@ -1,4 +0,0 @@
|
|||||||
- hosts: all
|
|
||||||
roles:
|
|
||||||
- web
|
|
||||||
- doku
|
|
@ -1,59 +0,0 @@
|
|||||||
- name: recuperation dokuwiki-stable.tgz depuis machine depl
|
|
||||||
get_url:
|
|
||||||
url: http://depl.sio.lan/store/dokuwiki-stable.tgz
|
|
||||||
dest: /tmp
|
|
||||||
|
|
||||||
- name: Extraction archive
|
|
||||||
unarchive:
|
|
||||||
src: /tmp/dokuwiki-stable.tgz
|
|
||||||
dest: /var/www/html/
|
|
||||||
remote_src: yes
|
|
||||||
|
|
||||||
- name: stat rept
|
|
||||||
stat:
|
|
||||||
path: /var/www/html/dokuwiki-2020-07-29
|
|
||||||
register: rept_stat
|
|
||||||
|
|
||||||
- name: Renommage de dokuwiki-stable
|
|
||||||
command: mv /var/www/html/dokuwiki-2020-07-29 /var/www/html/doku
|
|
||||||
when: rept_stat.stat.exists
|
|
||||||
|
|
||||||
- name: Droit root recursive
|
|
||||||
file:
|
|
||||||
path: /var/www/html/doku
|
|
||||||
state: directory
|
|
||||||
recurse: yes
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
|
|
||||||
- name: droit 755
|
|
||||||
file:
|
|
||||||
path: /var/www/html/doku
|
|
||||||
state: directory
|
|
||||||
mode: '0755'
|
|
||||||
recurse: yes
|
|
||||||
|
|
||||||
- name: droit apache data
|
|
||||||
file:
|
|
||||||
path: /var/www/html/doku/data
|
|
||||||
state: directory
|
|
||||||
owner: www-data
|
|
||||||
group: www-data
|
|
||||||
recurse: yes
|
|
||||||
|
|
||||||
- name: droit apache lib
|
|
||||||
file:
|
|
||||||
path: /var/www/html/doku/lib
|
|
||||||
state: directory
|
|
||||||
owner: www-data
|
|
||||||
group: www-data
|
|
||||||
recurse: yes
|
|
||||||
|
|
||||||
- name: droit apache conf
|
|
||||||
file:
|
|
||||||
path: /var/www/html/doku/conf
|
|
||||||
state: directory
|
|
||||||
owner: www-data
|
|
||||||
group: www-data
|
|
||||||
recurse: yes
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
|||||||
- name: installation apache2
|
|
||||||
apt:
|
|
||||||
name: apache2
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: installation php
|
|
||||||
apt:
|
|
||||||
name: php
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: installation php-mbstring
|
|
||||||
apt:
|
|
||||||
name: php-mbstring
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: installation php-gd
|
|
||||||
apt:
|
|
||||||
name: php-gd
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: installation php-xml
|
|
||||||
apt:
|
|
||||||
name: php-xml
|
|
||||||
state: present
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
|||||||
[adm]
|
|
||||||
infra
|
|
||||||
|
|
||||||
[web]
|
|
||||||
web1
|
|
||||||
web2
|
|
@ -1,6 +0,0 @@
|
|||||||
[adm]
|
|
||||||
infra
|
|
||||||
|
|
||||||
[web]
|
|
||||||
web1
|
|
||||||
web2
|
|
@ -1 +0,0 @@
|
|||||||
Salut
|
|
@ -1,31 +0,0 @@
|
|||||||
- hosts: adm
|
|
||||||
vars:
|
|
||||||
- proxy_port: 8080
|
|
||||||
- proxy_mem: 128
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
- name: Installation squid
|
|
||||||
apt:
|
|
||||||
name: squid
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Copie squid.conf squid.conf.j2
|
|
||||||
template:
|
|
||||||
src: squid.conf.j2
|
|
||||||
dest: /etc/squid/squid.conf
|
|
||||||
notify:
|
|
||||||
- restart squid
|
|
||||||
|
|
||||||
# - name: On ajoute http_access allow localnet
|
|
||||||
# replace:
|
|
||||||
# path: /etc/squid/squid.conf
|
|
||||||
# regexp: '^#http_access allow localnet'
|
|
||||||
# replace: 'http_access allow localnet'
|
|
||||||
# notify:
|
|
||||||
# - restart squid
|
|
||||||
|
|
||||||
handlers:
|
|
||||||
- name: restart squid
|
|
||||||
service:
|
|
||||||
name: squid
|
|
||||||
state: restarted
|
|
@ -1,29 +0,0 @@
|
|||||||
- hosts: web
|
|
||||||
tasks:
|
|
||||||
|
|
||||||
- name: decommente le chargement du module imudp dans rsyslog.conf
|
|
||||||
replace:
|
|
||||||
path: /etc/systemd/journald.conf
|
|
||||||
regexp: '^#ForwardToSyslog=yes'
|
|
||||||
replace: 'ForwardToSyslog=yes'
|
|
||||||
notify:
|
|
||||||
- restart journald
|
|
||||||
|
|
||||||
- name: Ajoute l'indication de serveur syslog distant si elle n'est pas presente
|
|
||||||
lineinfile:
|
|
||||||
path: /etc/rsyslog.conf
|
|
||||||
line: '*.* @192.168.0.23:514'
|
|
||||||
create: yes
|
|
||||||
notify:
|
|
||||||
- restart rsyslog
|
|
||||||
|
|
||||||
handlers:
|
|
||||||
- name: restart journald
|
|
||||||
service:
|
|
||||||
name: systemd-journald.service
|
|
||||||
state: restarted
|
|
||||||
|
|
||||||
- name: restart syslog
|
|
||||||
service:
|
|
||||||
name: rsyslog
|
|
||||||
state: restarted
|
|
@ -1,37 +0,0 @@
|
|||||||
- hosts: adm
|
|
||||||
tasks:
|
|
||||||
|
|
||||||
- name: decommente le chargement du module imudp dans rsyslog.conf
|
|
||||||
replace:
|
|
||||||
path: /etc/rsyslog.conf
|
|
||||||
regexp: '^#module\(load="imudp"\)'
|
|
||||||
replace: 'module(load="imudp")'
|
|
||||||
notify:
|
|
||||||
- restart rsyslog
|
|
||||||
|
|
||||||
- name: decommente le chargement du module imudp dans rsyslog.conf
|
|
||||||
replace:
|
|
||||||
path: /etc/rsyslog.conf
|
|
||||||
regexp: '^#input\(type="imudp" port="514"\)'
|
|
||||||
replace: 'input(type="imudp" port="514")'
|
|
||||||
notify:
|
|
||||||
- restart rsyslog
|
|
||||||
|
|
||||||
- name: decommente le chargement du module imudp dans rsyslog.conf
|
|
||||||
replace:
|
|
||||||
path: /etc/systemd/journald.conf
|
|
||||||
regexp: '^#ForwardToSyslog=yes'
|
|
||||||
replace: 'ForwardToSyslog=yes'
|
|
||||||
notify:
|
|
||||||
- restart journald
|
|
||||||
|
|
||||||
handlers:
|
|
||||||
- name: restart rsyslog
|
|
||||||
service:
|
|
||||||
name: rsyslog
|
|
||||||
state: restarted
|
|
||||||
|
|
||||||
- name: restart journald
|
|
||||||
service:
|
|
||||||
name: systemd-journald.service
|
|
||||||
state: restarted
|
|
@ -1,18 +0,0 @@
|
|||||||
- hosts: web
|
|
||||||
tasks:
|
|
||||||
- name: Installation apache2
|
|
||||||
apt:
|
|
||||||
name: apache2
|
|
||||||
state: present
|
|
||||||
- name: Installation php
|
|
||||||
apt:
|
|
||||||
name: php
|
|
||||||
state: present
|
|
||||||
- name: Installation php-mbstring
|
|
||||||
apt:
|
|
||||||
name: php-mbstring
|
|
||||||
state: present
|
|
||||||
- name: Copie index.html
|
|
||||||
copy:
|
|
||||||
src: index.html
|
|
||||||
dest: /var/www/html/
|
|
@ -1 +0,0 @@
|
|||||||
SBGswrABm13tZGpO70WKZjCtEF4YcGlJkBXORNgkJHE=
|
|
@ -1 +0,0 @@
|
|||||||
pKM5noo3ZF3v3t3fBJBYzvFt61ItJxIkEHC0uXkCgAU=
|
|
@ -1,14 +0,0 @@
|
|||||||
# générer des clés : cd /etc/wireguard; umask 077 ; wg genkey | tee private.key | wg pubkey > public.key
|
|
||||||
[Interface]
|
|
||||||
Address = 10.0.2.1/24 # Adresses autorisées dans le VPN
|
|
||||||
Listenport = 51820
|
|
||||||
|
|
||||||
# clé privée de machine A (actuelle)
|
|
||||||
PrivateKey = SBGswrABm13tZGpO70WKZjCtEF4YcGlJkBXORNgkJHE=
|
|
||||||
# UDP service port; 51820 is a common choice for WireGuard
|
|
||||||
ListenPort = 51820
|
|
||||||
|
|
||||||
[Peer]
|
|
||||||
# clé publique de machine B (l'autre)
|
|
||||||
PublicKey = qhiQishoQMM6Y/g7OnUeLNX5T2p0FQx2oq+F/qKQfVc=
|
|
||||||
AllowedIPs = 10.0.2.1/24 # le peer peut acceder au serveur
|
|
@ -1,11 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
num1="$1"
|
|
||||||
num2="$2"
|
|
||||||
nom="$3"
|
|
||||||
ip="$4"
|
|
||||||
|
|
||||||
qm clone "${num1}" "${num2}" --name "${nom}"
|
|
||||||
qm set "${num2}" --sshkeys id_rsa.pub
|
|
||||||
qm set "${num2}" --ipconfig0 ip="${ip}",gw=192.168.0.1
|
|
||||||
qm resize "${num2}" scsi0 8G
|
|
||||||
qm start "${num2}"
|
|
@ -1,16 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
num="$1"
|
|
||||||
#récupération de l'image Openstack Debian 11 au format qcow2
|
|
||||||
cd /var/lib/vz/template/qemu/
|
|
||||||
export http_proxy=http://10.121.38.1:8080
|
|
||||||
export https_proxy=http://10.121.38.1:8080
|
|
||||||
wget --no-check-certificate https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-genericcloud-amd64.qcow2
|
|
||||||
#Création de la VM a partir de l'image
|
|
||||||
qm create "${num}" --memory 1024 --net0 virtio,bridge=vmbr0
|
|
||||||
qm importdisk "${num}" /var/lib/vz/template/qemu/debian-11-generic-amd64.qcow2 local-lvm
|
|
||||||
#Paramètrage de la machine
|
|
||||||
qm set "${num}" --scsihw virtio-scsi-pci --scsi0 local-lvm:vm-"${num}"-disk-0 # on associe le disque scsi0 au LV vm-9000-disk-0
|
|
||||||
qm set "${num}" --boot c --bootdisk scsi0 # on définit le disque scsi0 comme disque de démarrage
|
|
||||||
qm set "${num}" --ide2 local-lvm:cloudinit # on joint le volume CDROM cloudinit utilisé pour le démarrage
|
|
||||||
qm set "${num}" --serial0 socket --vga serial0 # on définit une console série qu'on utilise comme affichage
|
|
||||||
qm template "${num}" # on définit la VM 9000 comme template
|
|
@ -1 +0,0 @@
|
|||||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCh2egCAcgBM+XXtvBfg6QYHB5+c0jqN1gzcfcs/2SaP/FTWk6u5mv+E9igbpMHrQKkH8z0ocNgKhV8nAHbtbCFa9UOF7kUESSnMWb6gt9qSiVY3PHb9iQHAbpQkqWgCgUKUTp7UEFLPd1QaCAFvbv43nGZGAFod/lX5h3HQV5goAyWgwairJbFSekkEvAF6hDFzaTSZaoi8tRRKDBDZVmTsL4v4ywM6/SIl/8COK0FJmEwIjU8jSOUAQtmbwXH70Zbegh30Osg8xLdnNrWJCKC9onf0V8s8djongk7wgj0KTBTrpPf26f9imY6Is24paHTGAFEfaqjhPyIz+i2hZKKMT5K5j0QYKOsThiReJs59cJIJpPgysbKnkNNMbhHtSL0XENmlhXzsKgfVVwTcvopE7+yoe1suCsqBrWtUw9o8RpHmzFrLH9HHJ5Ts1JCyMnTg10LzXlyK2ukWMbb0+qc0PMJrANTmpf77mJulkblQaOKSV38S5awS44NCZPRIbs= sio@lab213-23
|
|
@ -1 +0,0 @@
|
|||||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCh2egCAcgBM+XXtvBfg6QYHB5+c0jqN1gzcfcs/2SaP/FTWk6u5mv+E9igbpMHrQKkH8z0ocNgKhV8nAHbtbCFa9UOF7kUESSnMWb6gt9qSiVY3PHb9iQHAbpQkqWgCgUKUTp7UEFLPd1QaCAFvbv43nGZGAFod/lX5h3HQV5goAyWgwairJbFSekkEvAF6hDFzaTSZaoi8tRRKDBDZVmTsL4v4ywM6/SIl/8COK0FJmEwIjU8jSOUAQtmbwXH70Zbegh30Osg8xLdnNrWJCKC9onf0V8s8djongk7wgj0KTBTrpPf26f9imY6Is24paHTGAFEfaqjhPyIz+i2hZKKMT5K5j0QYKOsThiReJs59cJIJpPgysbKnkNNMbhHtSL0XENmlhXzsKgfVVwTcvopE7+yoe1suCsqBrWtUw9o8RpHmzFrLH9HHJ5Ts1JCyMnTg10LzXlyK2ukWMbb0+qc0PMJrANTmpf77mJulkblQaOKSV38S5awS44NCZPRIbs= sio@lab213-23
|
|
Loading…
x
Reference in New Issue
Block a user