From 4dd8dd9403414c62445c496b4518360da3411d60 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 19 Jul 2021 01:13:20 +0300 Subject: [PATCH] Initial Commit of the Switches config from 2019 and the Monitoring config from 2019 --- monitoring/icinga2/.gitignore | 1 + monitoring/icinga2/conf.d/api-users.conf | 9 + monitoring/icinga2/conf.d/app.conf | 1 + monitoring/icinga2/conf.d/apt.conf | 7 + monitoring/icinga2/conf.d/commands-new.conf | 124 ++++ monitoring/icinga2/conf.d/commands.conf | 187 ++++++ monitoring/icinga2/conf.d/dependencies.conf | 12 + monitoring/icinga2/conf.d/downtimes.conf | 20 + monitoring/icinga2/conf.d/groups.conf | 95 +++ monitoring/icinga2/conf.d/hosts.conf | 56 ++ monitoring/icinga2/conf.d/hosts/dell-ups.conf | 31 + .../hosts/equipment/voc-control-A-1.conf | 9 + .../hosts/equipment/voc-control-A-2.conf | 9 + .../hosts/equipment/voc-control-B-1.conf | 9 + .../hosts/equipment/voc-control-B-2.conf | 9 + .../hosts/equipment/voc-fbox-camera-B.conf | 9 + .../hosts/equipment/voc-fbox-camera-C.conf | 9 + .../hosts/equipment/voc-fbox-slides-B.conf | 9 + .../hosts/equipment/voc-fbox-slides-C.conf | 9 + .../conf.d/hosts/equipment/voc-icom-A-1.conf | 9 + .../conf.d/hosts/equipment/voc-icom-A-2.conf | 9 + .../conf.d/hosts/equipment/voc-icom-A-3.conf | 9 + .../conf.d/hosts/equipment/voc-icom-B-1.conf | 9 + .../conf.d/hosts/equipment/voc-icom-B-2.conf | 9 + .../conf.d/hosts/equipment/voc-icom-B-3.conf | 9 + .../conf.d/hosts/equipment/voc-scaler-A.conf | 9 + .../conf.d/hosts/equipment/voc-stream-A.conf | 9 + .../conf.d/hosts/equipment/voc-stream-B.conf | 9 + .../conf.d/hosts/equipment/voc-stream-C.conf | 9 + .../hosts/equipment/voc-videoswitcher-A.conf | 9 + .../icinga2/conf.d/hosts/misc/printer.conf | 9 + .../conf.d/hosts/misc/printer.conf-disabled | 9 + .../conf.d/hosts/overflow/rpi-tv-1.conf | 9 + .../conf.d/hosts/overflow/rpi-tv-2.conf | 9 + .../icinga2/conf.d/hosts/phones/phone-a.conf | 13 + .../icinga2/conf.d/hosts/phones/phone-b.conf | 13 + .../icinga2/conf.d/hosts/phones/phone-c.conf | 13 + .../icinga2/conf.d/hosts/phones/phone-d.conf | 13 + .../conf.d/hosts/phones/phone-noc-1.conf | 13 + .../conf.d/hosts/phones/phone-noc-2.conf | 13 + .../conf.d/hosts/phones/phone-reception.conf | 13 + .../conf.d/hosts/phones/phone-team.conf | 13 + .../icinga2/conf.d/hosts/router-vin.conf | 46 ++ .../icinga2/conf.d/hosts/switches/coresw.conf | 256 ++++++++ .../icinga2/conf.d/hosts/switches/f0sw.conf | 222 +++++++ .../icinga2/conf.d/hosts/switches/nocsw.conf | 13 + .../conf.d/hosts/switches/receptionsw.conf | 73 +++ .../icinga2/conf.d/hosts/switches/teamsw.conf | 70 +++ .../conf.d/hosts/switches/uplink-gkc.conf | 130 ++++ .../conf.d/hosts/switches/uplink-sw.conf | 72 +++ .../conf.d/hosts/switches/vocsw-A.conf | 69 ++ .../conf.d/hosts/switches/vocsw-B.conf | 69 ++ .../conf.d/hosts/switches/vocsw-C.conf | 71 +++ .../conf.d/hosts/switches/vocsw-D.conf | 70 +++ .../conf.d/hosts/wifi/openwrt-ap-cf-a1.conf | 32 + .../conf.d/hosts/wifi/openwrt-ap-cf-a2.conf | 32 + .../conf.d/hosts/wifi/openwrt-ap-cf-b1.conf | 29 + .../conf.d/hosts/wifi/openwrt-ap-cf-c1.conf | 29 + .../conf.d/hosts/wifi/openwrt-ap-cf-ch.conf | 33 + .../conf.d/hosts/wifi/openwrt-ap-cf-f-l.conf | 33 + .../conf.d/hosts/wifi/openwrt-ap-cf-f-r.conf | 29 + .../conf.d/hosts/wifi/openwrt-ap-cf-qws.conf | 32 + .../conf.d/hosts/wifi/openwrt-ap-cf-srv.conf | 32 + .../conf.d/hosts/wifi/openwrt-ap-ws-noc.conf | 29 + .../conf.d/hosts/wifi/openwrt-ap-ws-ws1.conf | 33 + .../conf.d/hosts/wifi/openwrt-ap-ws-ws2.conf | 33 + monitoring/icinga2/conf.d/notifications.conf | 42 ++ monitoring/icinga2/conf.d/satellite.conf | 33 + monitoring/icinga2/conf.d/services-new.conf | 137 ++++ monitoring/icinga2/conf.d/services.conf | 116 ++++ .../slack-service-notification-command.conf | 20 + .../conf.d/slack-service-notification.conf | 10 + monitoring/icinga2/conf.d/templates.conf | 83 +++ monitoring/icinga2/conf.d/timeperiods.conf | 35 ++ monitoring/icinga2/conf.d/users.conf | 17 + monitoring/icinga2/constants.conf | 31 + monitoring/icinga2/constants.conf.orig | 28 + .../icinga2/features-enabled/checker.conf | 5 + .../icinga2/features-enabled/command.conf | 7 + .../icinga2/features-enabled/graphite.conf | 12 + .../icinga2/features-enabled/ido-mysql.conf | 14 + .../icinga2/features-enabled/mainlog.conf | 8 + .../features-enabled/notification.conf | 5 + .../icinga2/features-enabled/perfdata.conf | 6 + monitoring/icinga2/icinga2.conf | 57 ++ monitoring/icinga2/init.conf | 7 + monitoring/icinga2/repository.d/README | 3 + .../icinga2/scripts/check_nwc_health.pl | 591 ++++++++++++++++++ monitoring/icinga2/scripts/check_rtmp.sh | 96 +++ .../icinga2/scripts/check_snmp_cisco_poe.pl | 477 ++++++++++++++ .../icinga2/scripts/mail-host-notification.sh | 171 +++++ .../scripts/mail-service-notification.sh | 176 ++++++ .../scripts/openwrt_check_interface_load.sh | 157 +++++ .../scripts/slack-service-notification.sh | 107 ++++ monitoring/icinga2/zones.conf | 63 ++ monitoring/icinga2/zones.d/README | 2 + monitoring/icingaweb2/authentication.ini | 3 + monitoring/icingaweb2/config.ini | 10 + monitoring/icingaweb2/groups.ini | 3 + .../icingaweb2/modules/graphite/config.ini | 4 + .../modules/monitoring/backends.ini | 3 + .../modules/monitoring/commandtransports.ini | 3 + .../icingaweb2/modules/monitoring/config.ini | 2 + monitoring/icingaweb2/resources.ini | 21 + monitoring/icingaweb2/roles.ini | 4 + monitoring/nginx-icinga-snippet.conf | 15 + switch-configs/coresw.cfg | 445 +++++++++++++ switch-configs/f0sw.cfg | 354 +++++++++++ switch-configs/nocsw.cfg | 320 ++++++++++ switch-configs/receptionsw.cfg | 172 +++++ switch-configs/teamsw.cfg | 171 +++++ switch-configs/uplink-gkc.cfg | 204 ++++++ switch-configs/uplink-sw.cfg | 142 +++++ switch-configs/vocsw-A.cfg | 174 ++++++ switch-configs/vocsw-B.cfg | 174 ++++++ switch-configs/vocsw-C.cfg | 174 ++++++ switch-configs/vocsw-D.cfg | 171 +++++ 117 files changed, 7476 insertions(+) create mode 100644 monitoring/icinga2/.gitignore create mode 100644 monitoring/icinga2/conf.d/api-users.conf create mode 100644 monitoring/icinga2/conf.d/app.conf create mode 100644 monitoring/icinga2/conf.d/apt.conf create mode 100644 monitoring/icinga2/conf.d/commands-new.conf create mode 100644 monitoring/icinga2/conf.d/commands.conf create mode 100644 monitoring/icinga2/conf.d/dependencies.conf create mode 100644 monitoring/icinga2/conf.d/downtimes.conf create mode 100644 monitoring/icinga2/conf.d/groups.conf create mode 100644 monitoring/icinga2/conf.d/hosts.conf create mode 100644 monitoring/icinga2/conf.d/hosts/dell-ups.conf create mode 100644 monitoring/icinga2/conf.d/hosts/equipment/voc-control-A-1.conf create mode 100644 monitoring/icinga2/conf.d/hosts/equipment/voc-control-A-2.conf create mode 100644 monitoring/icinga2/conf.d/hosts/equipment/voc-control-B-1.conf create mode 100644 monitoring/icinga2/conf.d/hosts/equipment/voc-control-B-2.conf create mode 100644 monitoring/icinga2/conf.d/hosts/equipment/voc-fbox-camera-B.conf create mode 100644 monitoring/icinga2/conf.d/hosts/equipment/voc-fbox-camera-C.conf create mode 100644 monitoring/icinga2/conf.d/hosts/equipment/voc-fbox-slides-B.conf create mode 100644 monitoring/icinga2/conf.d/hosts/equipment/voc-fbox-slides-C.conf create mode 100644 monitoring/icinga2/conf.d/hosts/equipment/voc-icom-A-1.conf create mode 100644 monitoring/icinga2/conf.d/hosts/equipment/voc-icom-A-2.conf create mode 100644 monitoring/icinga2/conf.d/hosts/equipment/voc-icom-A-3.conf create mode 100644 monitoring/icinga2/conf.d/hosts/equipment/voc-icom-B-1.conf create mode 100644 monitoring/icinga2/conf.d/hosts/equipment/voc-icom-B-2.conf create mode 100644 monitoring/icinga2/conf.d/hosts/equipment/voc-icom-B-3.conf create mode 100644 monitoring/icinga2/conf.d/hosts/equipment/voc-scaler-A.conf create mode 100644 monitoring/icinga2/conf.d/hosts/equipment/voc-stream-A.conf create mode 100644 monitoring/icinga2/conf.d/hosts/equipment/voc-stream-B.conf create mode 100644 monitoring/icinga2/conf.d/hosts/equipment/voc-stream-C.conf create mode 100644 monitoring/icinga2/conf.d/hosts/equipment/voc-videoswitcher-A.conf create mode 100644 monitoring/icinga2/conf.d/hosts/misc/printer.conf create mode 100644 monitoring/icinga2/conf.d/hosts/misc/printer.conf-disabled create mode 100644 monitoring/icinga2/conf.d/hosts/overflow/rpi-tv-1.conf create mode 100644 monitoring/icinga2/conf.d/hosts/overflow/rpi-tv-2.conf create mode 100644 monitoring/icinga2/conf.d/hosts/phones/phone-a.conf create mode 100644 monitoring/icinga2/conf.d/hosts/phones/phone-b.conf create mode 100644 monitoring/icinga2/conf.d/hosts/phones/phone-c.conf create mode 100644 monitoring/icinga2/conf.d/hosts/phones/phone-d.conf create mode 100644 monitoring/icinga2/conf.d/hosts/phones/phone-noc-1.conf create mode 100644 monitoring/icinga2/conf.d/hosts/phones/phone-noc-2.conf create mode 100644 monitoring/icinga2/conf.d/hosts/phones/phone-reception.conf create mode 100644 monitoring/icinga2/conf.d/hosts/phones/phone-team.conf create mode 100644 monitoring/icinga2/conf.d/hosts/router-vin.conf create mode 100644 monitoring/icinga2/conf.d/hosts/switches/coresw.conf create mode 100644 monitoring/icinga2/conf.d/hosts/switches/f0sw.conf create mode 100644 monitoring/icinga2/conf.d/hosts/switches/nocsw.conf create mode 100644 monitoring/icinga2/conf.d/hosts/switches/receptionsw.conf create mode 100644 monitoring/icinga2/conf.d/hosts/switches/teamsw.conf create mode 100644 monitoring/icinga2/conf.d/hosts/switches/uplink-gkc.conf create mode 100644 monitoring/icinga2/conf.d/hosts/switches/uplink-sw.conf create mode 100644 monitoring/icinga2/conf.d/hosts/switches/vocsw-A.conf create mode 100644 monitoring/icinga2/conf.d/hosts/switches/vocsw-B.conf create mode 100644 monitoring/icinga2/conf.d/hosts/switches/vocsw-C.conf create mode 100644 monitoring/icinga2/conf.d/hosts/switches/vocsw-D.conf create mode 100644 monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-a1.conf create mode 100644 monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-a2.conf create mode 100644 monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-b1.conf create mode 100644 monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-c1.conf create mode 100644 monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-ch.conf create mode 100644 monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-f-l.conf create mode 100644 monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-f-r.conf create mode 100644 monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-qws.conf create mode 100644 monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-srv.conf create mode 100644 monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-ws-noc.conf create mode 100644 monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-ws-ws1.conf create mode 100644 monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-ws-ws2.conf create mode 100644 monitoring/icinga2/conf.d/notifications.conf create mode 100644 monitoring/icinga2/conf.d/satellite.conf create mode 100644 monitoring/icinga2/conf.d/services-new.conf create mode 100644 monitoring/icinga2/conf.d/services.conf create mode 100644 monitoring/icinga2/conf.d/slack-service-notification-command.conf create mode 100644 monitoring/icinga2/conf.d/slack-service-notification.conf create mode 100644 monitoring/icinga2/conf.d/templates.conf create mode 100644 monitoring/icinga2/conf.d/timeperiods.conf create mode 100644 monitoring/icinga2/conf.d/users.conf create mode 100644 monitoring/icinga2/constants.conf create mode 100644 monitoring/icinga2/constants.conf.orig create mode 100644 monitoring/icinga2/features-enabled/checker.conf create mode 100644 monitoring/icinga2/features-enabled/command.conf create mode 100644 monitoring/icinga2/features-enabled/graphite.conf create mode 100644 monitoring/icinga2/features-enabled/ido-mysql.conf create mode 100644 monitoring/icinga2/features-enabled/mainlog.conf create mode 100644 monitoring/icinga2/features-enabled/notification.conf create mode 100644 monitoring/icinga2/features-enabled/perfdata.conf create mode 100644 monitoring/icinga2/icinga2.conf create mode 100644 monitoring/icinga2/init.conf create mode 100644 monitoring/icinga2/repository.d/README create mode 100644 monitoring/icinga2/scripts/check_nwc_health.pl create mode 100755 monitoring/icinga2/scripts/check_rtmp.sh create mode 100755 monitoring/icinga2/scripts/check_snmp_cisco_poe.pl create mode 100755 monitoring/icinga2/scripts/mail-host-notification.sh create mode 100755 monitoring/icinga2/scripts/mail-service-notification.sh create mode 100755 monitoring/icinga2/scripts/openwrt_check_interface_load.sh create mode 100755 monitoring/icinga2/scripts/slack-service-notification.sh create mode 100644 monitoring/icinga2/zones.conf create mode 100644 monitoring/icinga2/zones.d/README create mode 100644 monitoring/icingaweb2/authentication.ini create mode 100644 monitoring/icingaweb2/config.ini create mode 100644 monitoring/icingaweb2/groups.ini create mode 100644 monitoring/icingaweb2/modules/graphite/config.ini create mode 100644 monitoring/icingaweb2/modules/monitoring/backends.ini create mode 100644 monitoring/icingaweb2/modules/monitoring/commandtransports.ini create mode 100644 monitoring/icingaweb2/modules/monitoring/config.ini create mode 100644 monitoring/icingaweb2/resources.ini create mode 100644 monitoring/icingaweb2/roles.ini create mode 100644 monitoring/nginx-icinga-snippet.conf create mode 100644 switch-configs/coresw.cfg create mode 100644 switch-configs/f0sw.cfg create mode 100644 switch-configs/nocsw.cfg create mode 100644 switch-configs/receptionsw.cfg create mode 100644 switch-configs/teamsw.cfg create mode 100644 switch-configs/uplink-gkc.cfg create mode 100644 switch-configs/uplink-sw.cfg create mode 100644 switch-configs/vocsw-A.cfg create mode 100644 switch-configs/vocsw-B.cfg create mode 100644 switch-configs/vocsw-C.cfg create mode 100644 switch-configs/vocsw-D.cfg diff --git a/monitoring/icinga2/.gitignore b/monitoring/icinga2/.gitignore new file mode 100644 index 0000000..8a4852e --- /dev/null +++ b/monitoring/icinga2/.gitignore @@ -0,0 +1 @@ +features-available diff --git a/monitoring/icinga2/conf.d/api-users.conf b/monitoring/icinga2/conf.d/api-users.conf new file mode 100644 index 0000000..5d8b053 --- /dev/null +++ b/monitoring/icinga2/conf.d/api-users.conf @@ -0,0 +1,9 @@ +/** + * The ApiUser objects are used for authentication against the API. + */ +object ApiUser "root" { + password = "pass" + // client_cn = "" + + permissions = [ "*" ] +} diff --git a/monitoring/icinga2/conf.d/app.conf b/monitoring/icinga2/conf.d/app.conf new file mode 100644 index 0000000..3e4be0d --- /dev/null +++ b/monitoring/icinga2/conf.d/app.conf @@ -0,0 +1 @@ +object IcingaApplication "app" { } diff --git a/monitoring/icinga2/conf.d/apt.conf b/monitoring/icinga2/conf.d/apt.conf new file mode 100644 index 0000000..b2c77a0 --- /dev/null +++ b/monitoring/icinga2/conf.d/apt.conf @@ -0,0 +1,7 @@ +apply Service "apt" { + import "generic-service" + + check_command = "apt" + + assign where host.name == NodeName +} diff --git a/monitoring/icinga2/conf.d/commands-new.conf b/monitoring/icinga2/conf.d/commands-new.conf new file mode 100644 index 0000000..89ef50d --- /dev/null +++ b/monitoring/icinga2/conf.d/commands-new.conf @@ -0,0 +1,124 @@ +object CheckCommand "check_net_int" { + import "by_ssh" + vars.by_ssh_timeout = "420" + timeout = "420" + vars.by_ssh_command = PluginDir + "/check_interface_load.sh -w $int_warn$ -c $int_crit$" + vars.by_ssh_options = [ + "StrictHostKeyChecking=no", + "ControlMaster=auto", + "ControlPath=/var/run/icinga2/$host.name$", + "ControlPersist=20m" + ] + vars.int_warn="" + vars.int_crit="" +} + +object CheckCommand "check_open_ports" { + import "by_ssh" + vars.by_ssh_timeout = "420" + timeout = "420" + vars.by_ssh_command = PluginDir + "/check_network_ports.sh -p \"$ports$\" -H $host$" + vars.by_ssh_options = [ + "StrictHostKeyChecking=no", + "ControlMaster=auto", + "ControlPath=/var/run/icinga2/$host.name$", + "ControlPersist=20m" + ] + vars.ports="" + vars.host="" +} + +object CheckCommand "check_sensors" { + import "plugin-check-command" + command = PluginDir + "/check_sensors_vin" +} + +object CheckCommand "check_unbound" { + import "plugin-check-command" + command = PluginDir + "/check_unbound-ng.sh" +} +######################################################################################## +# OpenWRT APs +######################################################################################## +object CheckCommand "check_bandwidth" { + import "by_ssh" + vars.by_ssh_command = PluginDir + "/check_bandwidth.sh -i $interface$ -w $int_warn$ -c $int_crit$" + vars.by_ssh_timeout = "420" + timeout = "420" + vars.by_ssh_options = [ + "StrictHostKeyChecking=no", + "ControlMaster=auto", + "ControlPath=/var/run/icinga2/$host.name$", + "ControlPersist=20m" + ] + vars.int_warn="50000" + vars.int_crit="100000" +} + +####################################################################################### +# VOC switches +####################################################################################### +object CheckCommand "check_operstatus" { + import "plugin-check-command" + command = PluginDir + "/check_snmp -H $host$ -C openfest --oid $OID$ --miblist=IF-MIB -r $value$" + vars.host="" + vars.OID="" + vars.value="" + timeout = "120" +} + +object CheckCommand "check_operstatus_regex" { + import "plugin-check-command" + command = PluginDir + "/check_snmp -H $host$ -C openfest --oid $OID$ -r $value$" + vars.host="" + vars.OID="" + vars.value="" + timeout = "120" +} + +object CheckCommand "cisco-poe-check" { + import "plugin-check-command" + command = SysconfDir + "/icinga2/scripts/check_snmp_cisco_poe.pl -H $host.address$ -C openfest -w $host.vars.poe_watts_warning$ -c $host.vars.poe_watts_critical$" + timeout = "10" +} + +object CheckCommand "nwc_check" { + import "plugin-check-command" + command = SysconfDir + "/icinga2/scripts/check_nwc_health --hostname $host.address# --community openfest --mode $mode$" + vars.mode = "" +} + +object CheckCommand "rtmp-check" { + import "plugin-check-command" + command = SysconfDir + "/icinga2/scripts/check_rtmp.sh -t $timeout$ -u $monitoreduri$" + vars.monitoreduri = "" + vars.timeout = 10 +} + +object CheckCommand "check-audio-stream" { + import "plugin-check-command" + command = PluginDir + "/check_http -N -H openfest.org -p 8000 -E -u $monitoredpath$" + vars.monitoredpath = "" +} + +######################################################################################## +# Router services +######################################################################################## +object CheckCommand "bgp_sessions_check" { + import "plugin-check-command" + command = PluginDir + "/check_bird_bgp --asn $ASN$ --ebgp --sessions_down_ok $sessions_down$" + vars.ASN = "" + vars.sessions_down = "" +} + +####################################################################################### +# UPS checks +####################################################################################### +object CheckCommand "check_ups" { + import "plugin-check-command" + command = PluginDir + "/check_snmp -H $host$ -P 1 -C openfest --oid $OID$ --miblist=UPS-MIB -r $value$" + vars.host="" + vars.OID="" + vars.value="" + timeout = "120" +} diff --git a/monitoring/icinga2/conf.d/commands.conf b/monitoring/icinga2/conf.d/commands.conf new file mode 100644 index 0000000..bd511ce --- /dev/null +++ b/monitoring/icinga2/conf.d/commands.conf @@ -0,0 +1,187 @@ +/* Command objects */ + +/* Notification Commands + * + * Please check the documentation for all required and + * optional parameters. + */ + +object NotificationCommand "mail-host-notification" { + command = [ ConfigDir + "/scripts/mail-host-notification.sh" ] + + arguments += { + "-4" = "$notification_address$" + "-6" = "$notification_address6$" + "-b" = "$notification_author$" + "-c" = "$notification_comment$" + "-d" = { + required = true + value = "$notification_date$" + } + "-f" = { + value = "$notification_from$" + description = "Set from address. Requires GNU mailutils (Debian/Ubuntu) or mailx (RHEL/SUSE)" + } + "-i" = "$notification_icingaweb2url$" + "-l" = { + required = true + value = "$notification_hostname$" + } + "-n" = { + required = true + value = "$notification_hostdisplayname$" + } + "-o" = { + required = true + value = "$notification_hostoutput$" + } + "-r" = { + required = true + value = "$notification_useremail$" + } + "-s" = { + required = true + value = "$notification_hoststate$" + } + "-t" = { + required = true + value = "$notification_type$" + } + "-v" = "$notification_logtosyslog$" + } + + vars += { + notification_address = "$address$" + notification_address6 = "$address6$" + notification_author = "$notification.author$" + notification_comment = "$notification.comment$" + notification_type = "$notification.type$" + notification_date = "$icinga.long_date_time$" + notification_hostname = "$host.name$" + notification_hostdisplayname = "$host.display_name$" + notification_hostoutput = "$host.output$" + notification_hoststate = "$host.state$" + notification_useremail = "$user.email$" + } +} + +object NotificationCommand "mail-service-notification" { + command = [ ConfigDir + "/scripts/mail-service-notification.sh" ] + + arguments += { + "-4" = "$notification_address$" + "-6" = "$notification_address6$" + "-b" = "$notification_author$" + "-c" = "$notification_comment$" + "-d" = { + required = true + value = "$notification_date$" + } + "-e" = { + required = true + value = "$notification_servicename$" + } + "-f" = { + value = "$notification_from$" + description = "Set from address. Requires GNU mailutils (Debian/Ubuntu) or mailx (RHEL/SUSE)" + } + "-i" = "$notification_icingaweb2url$" + "-l" = { + required = true + value = "$notification_hostname$" + } + "-n" = { + required = true + value = "$notification_hostdisplayname$" + } + "-o" = { + required = true + value = "$notification_serviceoutput$" + } + "-r" = { + required = true + value = "$notification_useremail$" + } + "-s" = { + required = true + value = "$notification_servicestate$" + } + "-t" = { + required = true + value = "$notification_type$" + } + "-u" = { + required = true + value = "$notification_servicedisplayname$" + } + "-v" = "$notification_logtosyslog$" + } + + vars += { + notification_address = "$address$" + notification_address6 = "$address6$" + notification_author = "$notification.author$" + notification_comment = "$notification.comment$" + notification_type = "$notification.type$" + notification_date = "$icinga.long_date_time$" + notification_hostname = "$host.name$" + notification_hostdisplayname = "$host.display_name$" + notification_servicename = "$service.name$" + notification_serviceoutput = "$service.output$" + notification_servicestate = "$service.state$" + notification_useremail = "$user.email$" + notification_servicedisplayname = "$service.display_name$" + } +} + +/* + * If you prefer to use the notification scripts with environment + * variables instead of command line parameters, you can use + * the following commands. They have been updated from < 2.7 + * to support the new notification scripts and should help + * with an upgrade. + * Remove the comment blocks and comment the notification commands above. + */ + +/* + +object NotificationCommand "mail-host-notification" { + command = [ ConfigDir + "/scripts/mail-host-notification.sh" ] + + env = { + NOTIFICATIONTYPE = "$notification.type$" + HOSTDISPLAYNAME = "$host.display_name$" + HOSTNAME = "$host.name$" + HOSTADDRESS = "$address$" + HOSTSTATE = "$host.state$" + LONGDATETIME = "$icinga.long_date_time$" + HOSTOUTPUT = "$host.output$" + NOTIFICATIONAUTHORNAME = "$notification.author$" + NOTIFICATIONCOMMENT = "$notification.comment$" + HOSTDISPLAYNAME = "$host.display_name$" + USEREMAIL = "$user.email$" + } +} + +object NotificationCommand "mail-service-notification" { + command = [ ConfigDir + "/scripts/mail-service-notification.sh" ] + + env = { + NOTIFICATIONTYPE = "$notification.type$" + SERVICENAME = "$service.name$" + HOSTNAME = "$host.name$" + HOSTDISPLAYNAME = "$host.display_name$" + HOSTADDRESS = "$address$" + SERVICESTATE = "$service.state$" + LONGDATETIME = "$icinga.long_date_time$" + SERVICEOUTPUT = "$service.output$" + NOTIFICATIONAUTHORNAME = "$notification.author$" + NOTIFICATIONCOMMENT = "$notification.comment$" + HOSTDISPLAYNAME = "$host.display_name$" + SERVICEDISPLAYNAME = "$service.display_name$" + USEREMAIL = "$user.email$" + } +} + +*/ + diff --git a/monitoring/icinga2/conf.d/dependencies.conf b/monitoring/icinga2/conf.d/dependencies.conf new file mode 100644 index 0000000..e6c6b5b --- /dev/null +++ b/monitoring/icinga2/conf.d/dependencies.conf @@ -0,0 +1,12 @@ +apply Dependency "disable-host-service-checks" to Service { + disable_checks = true + assign where true +} + +apply Dependency "host-depends-on-host" to Host { + parent_host_name = host.vars.parent + disable_checks = true + disable_notifications = true + + assign where host.vars.parent +} diff --git a/monitoring/icinga2/conf.d/downtimes.conf b/monitoring/icinga2/conf.d/downtimes.conf new file mode 100644 index 0000000..0bed647 --- /dev/null +++ b/monitoring/icinga2/conf.d/downtimes.conf @@ -0,0 +1,20 @@ +/** + * The example downtime apply rule. + */ + +apply ScheduledDowntime "backup-downtime" to Service { + author = "icingaadmin" + comment = "Scheduled downtime for backup" + + ranges = { + monday = service.vars.backup_downtime + tuesday = service.vars.backup_downtime + wednesday = service.vars.backup_downtime + thursday = service.vars.backup_downtime + friday = service.vars.backup_downtime + saturday = service.vars.backup_downtime + sunday = service.vars.backup_downtime + } + + assign where service.vars.backup_downtime != "" +} diff --git a/monitoring/icinga2/conf.d/groups.conf b/monitoring/icinga2/conf.d/groups.conf new file mode 100644 index 0000000..80b41c1 --- /dev/null +++ b/monitoring/icinga2/conf.d/groups.conf @@ -0,0 +1,95 @@ +/** + * Host group examples. + */ + +object HostGroup "linux-servers" { + display_name = "Linux Servers" + + assign where host.vars.os == "Linux" +} + +/** + * Service group examples. + */ + +object ServiceGroup "ping" { + display_name = "Ping Checks" + + assign where match("ping*", service.name) +} + +object ServiceGroup "http" { + display_name = "HTTP Checks" + + assign where match("http*", service.check_command) +} + +object ServiceGroup "disk" { + display_name = "Disk Checks" + + assign where match("disk*", service.check_command) +} + +object ServiceGroup "openwrt" { + display_name = "openwrt APs" + + assign where "openwrt" in host.vars.groups +} + +object ServiceGroup "vocsw" { + display_name = "Video Team switches" + + assign where "vocsw" in host.vars.groups +} + +object ServiceGroup "ciscosw" { + display_name = "CISCO Switches" + + assign where "ciscosw" in host.vars.groups +} + +object HostGroup "vocsw" { + display_name = "Video Team switches" + + assign where "vocsw" in host.vars.groups +} + +object HostGroup "ciscosw" { + display_name = "CISCO Switches" + + assign where "ciscosw" in host.vars.groups +} + +object HostGroup "misc" { + display_name = "Misc devices" + assign where "misc" in host.vars.groups +} + +object HostGroup "overflow" { + display_name = "Overflow RPIs" + assign where "overflow" in host.vars.groups +} + +object HostGroup "equipment" { + display_name = "Video team equipment" + assign where "equipment" in host.vars.groups +} +object HostGroup "phones" { + display_name = "Telephones" + assign where "phone" in host.vars.groups +} + +object HostGroup "wifi" { + display_name = "Access points" + assign where "openwrt" in host.vars.groups +} + +object HostGroup "ups" { + display_name = "UPS-es" + assign where "ups" in host.vars.groups +} + +object HostGroup "routers" { + display_name = "Routers" + assign where "routers" in host.vars.groups +} diff --git a/monitoring/icinga2/conf.d/hosts.conf b/monitoring/icinga2/conf.d/hosts.conf new file mode 100644 index 0000000..e7aa6ba --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts.conf @@ -0,0 +1,56 @@ +/* + * Host definitions with object attributes + * used for apply rules for Service, Notification, + * Dependency and ScheduledDowntime objects. + * + * Tip: Use `icinga2 object list --type Host` to + * list all host objects after running + * configuration validation (`icinga2 daemon -C`). + */ + +/* + * This is an example host based on your + * local host's FQDN. Specify the NodeName + * constant in `constants.conf` or use your + * own description, e.g. "db-host-1". + */ + +object Host NodeName { + /* Import the default host template defined in `templates.conf`. */ + import "generic-host" + + /* Specify the address attributes for checks e.g. `ssh` or `http`. */ + address = "127.0.0.1" + address6 = "::1" + + /* Set custom variable `os` for hostgroup assignment in `groups.conf`. */ + vars.os = "Linux" + + /* Define http vhost attributes for service apply rules in `services.conf`. */ + vars.http_vhosts["http"] = { + http_uri = "/" + } + /* Uncomment if you've sucessfully installed Icinga Web 2. */ + //vars.http_vhosts["Icinga Web 2"] = { + // http_uri = "/icingaweb2" + //} + + /* Define disks and attributes for service apply rules in `services.conf`. */ + vars.disks["disk"] = { + /* No parameters. */ + } + vars.disks["disk /"] = { + disk_partitions = "/" + } + + /* Define notification mail attributes for notification apply rules in `notifications.conf`. */ + vars.notification["mail"] = { + /* The UserGroup `icingaadmins` is defined in `users.conf`. */ + groups = [ "icingaadmins" ] + } + + vars.notification["slack"] = { + groups = [ "icingaadmins"] + } +} + diff --git a/monitoring/icinga2/conf.d/hosts/dell-ups.conf b/monitoring/icinga2/conf.d/hosts/dell-ups.conf new file mode 100644 index 0000000..9fa93e3 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/dell-ups.conf @@ -0,0 +1,31 @@ +object Host "dell-ups.openfest.org" { + import "generic-host" + + address = "dell-ups" + vars.groups = [ "ups" ] + + vars.ups[ "Battery Status" ] = { + OID = "1.3.6.1.2.1.33.1.2.1.0" + value = 2 + } + vars.ups[ "Seconds on Battery" ] = { + OID = "1.3.6.1.2.1.33.1.2.2.0" + value = 0 + } + vars.ups[ "Estimated Min Remaining" ] = { + OID = "1.3.6.1.2.1.33.1.2.3.0" + } + vars.ups[ "Estimated Charge Remaining" ] = { + OID = "1.3.6.1.2.1.33.1.2.4.0" + } + vars.ups[ "Temperature" ] = { + OID = "1.3.6.1.2.1.33.1.2.7.0" + } + + vars.notification["slack"] = { + groups = [ "icingaadmins" ] + } + + +} + diff --git a/monitoring/icinga2/conf.d/hosts/equipment/voc-control-A-1.conf b/monitoring/icinga2/conf.d/hosts/equipment/voc-control-A-1.conf new file mode 100644 index 0000000..62dfbfd --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/equipment/voc-control-A-1.conf @@ -0,0 +1,9 @@ +object Host "voc-control-A-1" { + import "generic-host" + + # main room laptop/controller [1/2] + address = "control-A-1" + vars.groups = [ "equipment" ] + + vars.parent = "vocsw-A.openfest.org" +} diff --git a/monitoring/icinga2/conf.d/hosts/equipment/voc-control-A-2.conf b/monitoring/icinga2/conf.d/hosts/equipment/voc-control-A-2.conf new file mode 100644 index 0000000..0cbb298 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/equipment/voc-control-A-2.conf @@ -0,0 +1,9 @@ +object Host "voc-control-A-2" { + import "generic-host" + + # main room laptop/controller [2/2] + address = "control-A-2" + vars.groups = [ "equipment" ] + + vars.parent = "vocsw-A.openfest.org" +} diff --git a/monitoring/icinga2/conf.d/hosts/equipment/voc-control-B-1.conf b/monitoring/icinga2/conf.d/hosts/equipment/voc-control-B-1.conf new file mode 100644 index 0000000..932ba43 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/equipment/voc-control-B-1.conf @@ -0,0 +1,9 @@ +object Host "voc-control-B-1" { + import "generic-host" + + # second room laptop/controller [1/2] + address = "control-B-1" + vars.groups = [ "equipment" ] + + vars.parent = "vocsw-B.openfest.org" +} diff --git a/monitoring/icinga2/conf.d/hosts/equipment/voc-control-B-2.conf b/monitoring/icinga2/conf.d/hosts/equipment/voc-control-B-2.conf new file mode 100644 index 0000000..d9669ac --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/equipment/voc-control-B-2.conf @@ -0,0 +1,9 @@ +object Host "voc-control-B-2" { + import "generic-host" + + # second room laptop/controller [2/2] + address = "control-B-2" + vars.groups = [ "equipment" ] + + vars.parent = "vocsw-B.openfest.org" +} diff --git a/monitoring/icinga2/conf.d/hosts/equipment/voc-fbox-camera-B.conf b/monitoring/icinga2/conf.d/hosts/equipment/voc-fbox-camera-B.conf new file mode 100644 index 0000000..c81813c --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/equipment/voc-fbox-camera-B.conf @@ -0,0 +1,9 @@ +object Host "voc-fbox-camera-B" { + import "generic-host" + + # FOSDEM cambox in room B + address = "fbox-camera-B" + vars.groups = [ "equipment" ] + + vars.parent = "coresw.openfest.org" +} diff --git a/monitoring/icinga2/conf.d/hosts/equipment/voc-fbox-camera-C.conf b/monitoring/icinga2/conf.d/hosts/equipment/voc-fbox-camera-C.conf new file mode 100644 index 0000000..11239cb --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/equipment/voc-fbox-camera-C.conf @@ -0,0 +1,9 @@ +object Host "voc-fbox-camera-C" { + import "generic-host" + + # FOSDEM cambox in room C + address = "fbox-camera-C" + vars.groups = [ "equipment" ] + + vars.parent = "coresw.openfest.org" +} diff --git a/monitoring/icinga2/conf.d/hosts/equipment/voc-fbox-slides-B.conf b/monitoring/icinga2/conf.d/hosts/equipment/voc-fbox-slides-B.conf new file mode 100644 index 0000000..38584cc --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/equipment/voc-fbox-slides-B.conf @@ -0,0 +1,9 @@ +object Host "voc-fbox-slides-B" { + import "generic-host" + + # FOSDEM slidebox in room B + address = "fbox-slides-B" + vars.groups = [ "equipment" ] + + vars.parent = "coresw.openfest.org" +} diff --git a/monitoring/icinga2/conf.d/hosts/equipment/voc-fbox-slides-C.conf b/monitoring/icinga2/conf.d/hosts/equipment/voc-fbox-slides-C.conf new file mode 100644 index 0000000..70b70f9 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/equipment/voc-fbox-slides-C.conf @@ -0,0 +1,9 @@ +object Host "voc-fbox-slides-C" { + import "generic-host" + + # FOSDEM slidebox in room C + address = "fbox-slides-C" + vars.groups = [ "equipment" ] + + vars.parent = "coresw.openfest.org" +} diff --git a/monitoring/icinga2/conf.d/hosts/equipment/voc-icom-A-1.conf b/monitoring/icinga2/conf.d/hosts/equipment/voc-icom-A-1.conf new file mode 100644 index 0000000..cbc16ba --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/equipment/voc-icom-A-1.conf @@ -0,0 +1,9 @@ +object Host "voc-icom-A-1" { + import "generic-host" + + # RPI intercom receiver 1 - main room [1/3] + address = "icom-A-1" + vars.groups = [ "equipment" ] + + vars.parent = "vocsw-A.openfest.org" +} diff --git a/monitoring/icinga2/conf.d/hosts/equipment/voc-icom-A-2.conf b/monitoring/icinga2/conf.d/hosts/equipment/voc-icom-A-2.conf new file mode 100644 index 0000000..cada79e --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/equipment/voc-icom-A-2.conf @@ -0,0 +1,9 @@ +object Host "voc-icom-A-2" { + import "generic-host" + + # RPI intercom receiver 2 - main room [2/3] + address = "icom-A-2" + vars.groups = [ "equipment" ] + + vars.parent = "vocsw-A.openfest.org" +} diff --git a/monitoring/icinga2/conf.d/hosts/equipment/voc-icom-A-3.conf b/monitoring/icinga2/conf.d/hosts/equipment/voc-icom-A-3.conf new file mode 100644 index 0000000..5c7fa98 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/equipment/voc-icom-A-3.conf @@ -0,0 +1,9 @@ +object Host "voc-icom-A-3" { + import "generic-host" + + # RPI intercom receiver 3 - main room [3/3] + address = "icom-A-3" + vars.groups = [ "equipment" ] + + vars.parent = "vocsw-A.openfest.org" +} diff --git a/monitoring/icinga2/conf.d/hosts/equipment/voc-icom-B-1.conf b/monitoring/icinga2/conf.d/hosts/equipment/voc-icom-B-1.conf new file mode 100644 index 0000000..e090037 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/equipment/voc-icom-B-1.conf @@ -0,0 +1,9 @@ +object Host "voc-icom-B-1" { + import "generic-host" + + # RPI intercom receiver 1 - second room [1/3] + address = "icom-B-1" + vars.groups = [ "equipment" ] + + vars.parent = "vocsw-B.openfest.org" +} diff --git a/monitoring/icinga2/conf.d/hosts/equipment/voc-icom-B-2.conf b/monitoring/icinga2/conf.d/hosts/equipment/voc-icom-B-2.conf new file mode 100644 index 0000000..00f2978 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/equipment/voc-icom-B-2.conf @@ -0,0 +1,9 @@ +object Host "voc-icom-B-2" { + import "generic-host" + + # RPI intercom receiver 2 - second room [2/3] + address = "icom-B-2" + vars.groups = [ "equipment" ] + + vars.parent = "vocsw-B.openfest.org" +} diff --git a/monitoring/icinga2/conf.d/hosts/equipment/voc-icom-B-3.conf b/monitoring/icinga2/conf.d/hosts/equipment/voc-icom-B-3.conf new file mode 100644 index 0000000..e77b9e8 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/equipment/voc-icom-B-3.conf @@ -0,0 +1,9 @@ +object Host "voc-icom-B-3" { + import "generic-host" + + # RPI intercom receiver 3 - second room [3/3] + address = "icom-B-3" + vars.groups = [ "equipment" ] + + vars.parent = "vocsw-B.openfest.org" +} diff --git a/monitoring/icinga2/conf.d/hosts/equipment/voc-scaler-A.conf b/monitoring/icinga2/conf.d/hosts/equipment/voc-scaler-A.conf new file mode 100644 index 0000000..b6c21e6 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/equipment/voc-scaler-A.conf @@ -0,0 +1,9 @@ +object Host "voc-scaler-A" { + import "generic-host" + + # Atlona scaler in room A + address = "scaler-A" + vars.groups = [ "equipment" ] + + vars.parent = "vocsw-A.openfest.org" +} diff --git a/monitoring/icinga2/conf.d/hosts/equipment/voc-stream-A.conf b/monitoring/icinga2/conf.d/hosts/equipment/voc-stream-A.conf new file mode 100644 index 0000000..87a0751 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/equipment/voc-stream-A.conf @@ -0,0 +1,9 @@ +object Host "voc-stream-A" { + import "generic-host" + + # main room streamer + address = "stream-A" + vars.groups = [ "equipment" ] + + vars.parent = "vocsw-A.openfest.org" +} diff --git a/monitoring/icinga2/conf.d/hosts/equipment/voc-stream-B.conf b/monitoring/icinga2/conf.d/hosts/equipment/voc-stream-B.conf new file mode 100644 index 0000000..2cedf73 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/equipment/voc-stream-B.conf @@ -0,0 +1,9 @@ +object Host "voc-stream-B" { + import "generic-host" + + # second room streamer + address = "stream-B" + vars.groups = [ "equipment" ] + + vars.parent = "vocsw-B.openfest.org" +} diff --git a/monitoring/icinga2/conf.d/hosts/equipment/voc-stream-C.conf b/monitoring/icinga2/conf.d/hosts/equipment/voc-stream-C.conf new file mode 100644 index 0000000..62c9b14 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/equipment/voc-stream-C.conf @@ -0,0 +1,9 @@ +object Host "voc-stream-C" { + import "generic-host" + + # third room streamer + address = "stream-C" + vars.groups = [ "equipment" ] + + vars.parent = "vocsw-C.openfest.org" +} diff --git a/monitoring/icinga2/conf.d/hosts/equipment/voc-videoswitcher-A.conf b/monitoring/icinga2/conf.d/hosts/equipment/voc-videoswitcher-A.conf new file mode 100644 index 0000000..1f57cbb --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/equipment/voc-videoswitcher-A.conf @@ -0,0 +1,9 @@ +object Host "voc-videoswitcher-A" { + import "generic-host" + + # Atlona scaler in room A + address = "videoswitcher-A" + vars.groups = [ "equipment" ] + + vars.parent = "vocsw-A.openfest.org" +} diff --git a/monitoring/icinga2/conf.d/hosts/misc/printer.conf b/monitoring/icinga2/conf.d/hosts/misc/printer.conf new file mode 100644 index 0000000..c59c1c4 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/misc/printer.conf @@ -0,0 +1,9 @@ +object Host "printer-1" { + import "generic-host" + + # reception printer + address = "printer-1" + vars.groups = [ "misc" ] + + vars.parent = "receptionsw.openfest.org" +} diff --git a/monitoring/icinga2/conf.d/hosts/misc/printer.conf-disabled b/monitoring/icinga2/conf.d/hosts/misc/printer.conf-disabled new file mode 100644 index 0000000..c59c1c4 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/misc/printer.conf-disabled @@ -0,0 +1,9 @@ +object Host "printer-1" { + import "generic-host" + + # reception printer + address = "printer-1" + vars.groups = [ "misc" ] + + vars.parent = "receptionsw.openfest.org" +} diff --git a/monitoring/icinga2/conf.d/hosts/overflow/rpi-tv-1.conf b/monitoring/icinga2/conf.d/hosts/overflow/rpi-tv-1.conf new file mode 100644 index 0000000..5db7e53 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/overflow/rpi-tv-1.conf @@ -0,0 +1,9 @@ +object Host "rpi-tv-1" { + import "generic-host" + + # Overflow TV-1 + address = "tv-1" + vars.groups = [ "overflow" ] + + vars.parent = "teamsw.openfest.org" +} diff --git a/monitoring/icinga2/conf.d/hosts/overflow/rpi-tv-2.conf b/monitoring/icinga2/conf.d/hosts/overflow/rpi-tv-2.conf new file mode 100644 index 0000000..258eda6 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/overflow/rpi-tv-2.conf @@ -0,0 +1,9 @@ +object Host "rpi-tv-2" { + import "generic-host" + + # Overflow TV-2 + address = "tv-2" + vars.groups = [ "overflow" ] + + vars.parent = "teamsw.openfest.org" +} diff --git a/monitoring/icinga2/conf.d/hosts/phones/phone-a.conf b/monitoring/icinga2/conf.d/hosts/phones/phone-a.conf new file mode 100644 index 0000000..17fa5d3 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/phones/phone-a.conf @@ -0,0 +1,13 @@ +object Host "phone-A" { + import "generic-host" + + address = "phone-A" + vars.groups = [ "phone" ] + + vars.parent = "vocsw-A.openfest.org" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + # vars.specification = "vocsw" + +} diff --git a/monitoring/icinga2/conf.d/hosts/phones/phone-b.conf b/monitoring/icinga2/conf.d/hosts/phones/phone-b.conf new file mode 100644 index 0000000..eb23220 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/phones/phone-b.conf @@ -0,0 +1,13 @@ +object Host "phone-B" { + import "generic-host" + + address = "phone-B" + vars.groups = [ "phone" ] + + vars.parent = "vocsw-B.openfest.org" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + # vars.specification = "vocsw" + +} diff --git a/monitoring/icinga2/conf.d/hosts/phones/phone-c.conf b/monitoring/icinga2/conf.d/hosts/phones/phone-c.conf new file mode 100644 index 0000000..4138665 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/phones/phone-c.conf @@ -0,0 +1,13 @@ +object Host "phone-C" { + import "generic-host" + + address = "phone-C" + vars.groups = [ "phone" ] + + vars.parent = "vocsw-C.openfest.org" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + # vars.specification = "vocsw" + +} diff --git a/monitoring/icinga2/conf.d/hosts/phones/phone-d.conf b/monitoring/icinga2/conf.d/hosts/phones/phone-d.conf new file mode 100644 index 0000000..15d828d --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/phones/phone-d.conf @@ -0,0 +1,13 @@ +object Host "phone-D" { + import "generic-host" + + address = "phone-D" + vars.groups = [ "phone" ] + + vars.parent = "vocsw-D.openfest.org" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + # vars.specification = "vocsw" + +} diff --git a/monitoring/icinga2/conf.d/hosts/phones/phone-noc-1.conf b/monitoring/icinga2/conf.d/hosts/phones/phone-noc-1.conf new file mode 100644 index 0000000..c355963 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/phones/phone-noc-1.conf @@ -0,0 +1,13 @@ +object Host "phone-noc-1" { + import "generic-host" + + address = "phone-noc-1" + vars.groups = [ "phone" ] + + vars.parent = "nocsw.openfest.org" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + # vars.specification = "vocsw" + +} diff --git a/monitoring/icinga2/conf.d/hosts/phones/phone-noc-2.conf b/monitoring/icinga2/conf.d/hosts/phones/phone-noc-2.conf new file mode 100644 index 0000000..b9a4409 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/phones/phone-noc-2.conf @@ -0,0 +1,13 @@ +object Host "phone-noc-2" { + import "generic-host" + + address = "phone-noc-2" + vars.groups = [ "phone" ] + + vars.parent = "nocsw.openfest.org" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + # vars.specification = "vocsw" + +} diff --git a/monitoring/icinga2/conf.d/hosts/phones/phone-reception.conf b/monitoring/icinga2/conf.d/hosts/phones/phone-reception.conf new file mode 100644 index 0000000..1a1ce2e --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/phones/phone-reception.conf @@ -0,0 +1,13 @@ +object Host "phone-reception" { + import "generic-host" + + address = "phone-reception" + vars.groups = [ "phone" ] + + vars.parent = "receptionsw.openfest.org" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + # vars.specification = "vocsw" + +} diff --git a/monitoring/icinga2/conf.d/hosts/phones/phone-team.conf b/monitoring/icinga2/conf.d/hosts/phones/phone-team.conf new file mode 100644 index 0000000..2c39d95 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/phones/phone-team.conf @@ -0,0 +1,13 @@ +object Host "phone-team" { + import "generic-host" + + address = "phone-team" + vars.groups = [ "phone" ] + + vars.parent = "teamsw.openfest.org" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + # vars.specification = "vocsw" + +} diff --git a/monitoring/icinga2/conf.d/hosts/router-vin.conf b/monitoring/icinga2/conf.d/hosts/router-vin.conf new file mode 100644 index 0000000..2c23979 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/router-vin.conf @@ -0,0 +1,46 @@ +object Host "vin-external.openfest.org" { + import "generic-host" + + address = "185.117.82.237" + # check_command = "xxx_health" + # vars.extra_port_check = "" + vars.by_ssh_port = "22" + vars.by_ssh_logname = "nagios" + vars.by_ssh_identity = "/var/lib/nagios/.ssh/id_rsa" + vars.groups = [ "routers" ] + + vars.net_interfaces = [ "bond0", "bond0.20", "bond0.21", "bond0.22", "bond0.23", "bond0.24", "bond0.25", "bond0.26", "bond0.4001", "eno1", "enp1s0f4", "enp1s0f4d1" ] + + vars.open_ports = "80 179 2004 53 22 7002 8443 443" + + vars.ASN = "65500" + vars.sessions_down = "hawk_pri marla_pri marla_tp_v spitfire_pri" + + vars.notification["slack"] = { + groups = [ "icingaadmins" ] + } + + vars.rtmp_check[ "hall-a" ] = { + monitoreduri = "rtmp://127.0.0.1/st/hall-a" + timeout =15 + } + vars.rtmp_check[ "hall-b" ] = { + monitoreduri = "rtmp://127.0.0.1/st/hall-b" + timeout =15 + } + vars.rtmp_check[ "hall-c" ] = { + monitoreduri = "rtmp://127.0.0.1/st/hall-c" + timeout =15 + } + vars.audiostream_check[ "hall-a-sound" ] = { + monitoredpath = "/halla.mp3" + } + vars.audiostream_check[ "hall-b-sound" ] = { + monitoredpath = "/hallb.mp3" + } + vars.audiostream_check[ "hall-c-sound" ] = { + monitoredpath = "/hallc.mp3" + } + +} + diff --git a/monitoring/icinga2/conf.d/hosts/switches/coresw.conf b/monitoring/icinga2/conf.d/hosts/switches/coresw.conf new file mode 100644 index 0000000..08b3105 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/switches/coresw.conf @@ -0,0 +1,256 @@ +object Host "coresw.openfest.org" { + import "generic-host" + + address = "coresw" + vars.groups = [ "ciscosw" ] + + # check_command = "xxx_health" + # vars.extra_port_check = "" + # vars.specification = "vocsw" + + # vin - primary link + vars.snmp_ifaces [ "TenGigabitEthernet1/0/2" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10202" + value = "1" + } + + # debug + vars.snmp_ifaces [ "GigabitEthernet1/0/1" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10101" + value = "1|2" + } + + # debug/trunk + vars.snmp_ifaces [ "GigabitEthernet1/0/2" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10102" + value = "1|2" + } + + # vin/backup + vars.snmp_ifaces [ "GigabitEthernet1/0/3" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10103" + value = "1|2" + } + + # aps + vars.snmp_ifaces [ "GigabitEthernet1/0/5" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10105" + value = "1" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/6" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10106" + value = "1" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/7" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10107" + value = "1" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/8" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10108" + value = "1" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/9" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10109" + value = "1" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/10" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10110" + value = "1" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/11" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10111" + value = "1" + } + + # dowstream switches + # reception-sw + vars.snmp_ifaces [ "GigabitEthernet1/0/17" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10117" + value = "1" + } + # team-sw + vars.snmp_ifaces [ "GigabitEthernet1/0/18" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10118" + value = "1" + } + # vocsw-A + vars.snmp_ifaces [ "GigabitEthernet1/0/19" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10119" + value = "1" + } + # vocsw-B + vars.snmp_ifaces [ "GigabitEthernet1/0/20" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10120" + value = "1" + } + # vocsw-C + vars.snmp_ifaces [ "GigabitEthernet1/0/21" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10121" + value = "1" + } + # vocsw-D + vars.snmp_ifaces [ "GigabitEthernet1/0/22" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10122" + value = "1" + } + + # presenters + vars.snmp_ifaces [ "GigabitEthernet1/0/24" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10124" + value = "1|2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/25" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10125" + value = "1|2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/26" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10126" + value = "1|2" + } + + # camboxes + vars.snmp_ifaces [ "GigabitEthernet1/0/27" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10127" + value = "1" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/28" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10128" + value = "1" + } + + # techpark + vars.snmp_ifaces [ "GigabitEthernet1/0/48" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10148" + value = "1" + } + + # f0sw + vars.snmp_ifaces [ "GigabitEthernet1/0/49" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10149" + value = "1" + } + # ipacct + vars.snmp_ifaces [ "GigabitEthernet1/0/50" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10150" + value = "1" + } + # ups + vars.snmp_ifaces [ "GigabitEthernet1/0/41" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10141" + value = "1" + } + + # down + vars.snmp_ifaces [ "TenGigabitEthernet1/0/1" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10201" + value = "2" + } + + vars.snmp_ifaces [ "GigabitEthernet1/0/12" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10112" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/13" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10113" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/14" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10114" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/15" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10115" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/16" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10116" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/4" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10104" + value = "1|2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/23" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10123" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/29" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10129" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/30" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10130" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/31" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10131" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/32" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10132" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/33" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10133" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/34" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10134" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/35" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10135" + value = "1|2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/36" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10136" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/37" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10137" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/38" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10138" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/39" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10139" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/40" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10140" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/42" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10142" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/43" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10143" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/44" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10144" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/45" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10145" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/46" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10146" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet1/0/47" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10147" + value = "2" + } + vars.snmp_ifaces [ "FastEthernet0" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.14502" + value = "2" + } + vars.snmp_uptime = "true" + vars.poe_watts_warning = "300" + vars.poe_watts_critical = "100" +} diff --git a/monitoring/icinga2/conf.d/hosts/switches/f0sw.conf b/monitoring/icinga2/conf.d/hosts/switches/f0sw.conf new file mode 100644 index 0000000..c3ba527 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/switches/f0sw.conf @@ -0,0 +1,222 @@ +object Host "f0sw.openfest.org" { + import "generic-host" + + address = "f0sw" + vars.groups = [ "ciscosw" ] + + vars.parent = "coresw.openfest.org" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + # vars.specification = "vocsw" + + #nocsw + vars.snmp_ifaces [ "GigabitEthernet0/1" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10101" + value = "1" + } + + # aps + vars.snmp_ifaces [ "GigabitEthernet0/2" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10102" + value = "1" + } + vars.snmp_ifaces [ "GigabitEthernet0/3" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10103" + value = "1" + } + + # wired maybe + vars.snmp_ifaces [ "GigabitEthernet0/11" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10111" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet0/12" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10112" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet0/13" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10113" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet0/14" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10114" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet0/15" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10115" + value = "2" + } + vars.snmp_ifaces [ "GigabitEthernet0/16" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10116" + value = "2" + } + + # Overflow raspberry + vars.snmp_ifaces [ "GigabitEthernet0/20" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10120" + value = "1" + } + # uplink + vars.snmp_ifaces [ "GigabitEthernet0/49" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10149" + value = "1" + } + + # down +vars.snmp_ifaces [ "GigabitEthernet0/04" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10104" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/05" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10105" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/06" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10106" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/07" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10107" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/08" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10108" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/09" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10109" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/10" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10110" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/17" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10117" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/18" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10118" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/19" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10119" + value = "2" +} + +vars.snmp_ifaces [ "GigabitEthernet0/21" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10121" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/22" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10122" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/23" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10123" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/24" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10124" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/25" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10125" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/26" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10126" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/27" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10127" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/28" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10128" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/29" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10129" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/30" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10130" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/31" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10131" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/32" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10132" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/33" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10133" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/34" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10134" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/35" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10135" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/36" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10136" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/37" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10137" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/38" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10138" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/39" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10139" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/40" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10140" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/41" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10141" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/42" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10142" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/43" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10143" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/44" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10144" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/45" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10145" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/46" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10146" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/47" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10147" + value = "2" +} +vars.snmp_ifaces [ "GigabitEthernet0/48" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10148" + value = "2" +} + + vars.snmp_uptime = "true" +} diff --git a/monitoring/icinga2/conf.d/hosts/switches/nocsw.conf b/monitoring/icinga2/conf.d/hosts/switches/nocsw.conf new file mode 100644 index 0000000..9a6c4cc --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/switches/nocsw.conf @@ -0,0 +1,13 @@ +object Host "nocsw.openfest.org" { + import "generic-host" + + address = "nocsw" + vars.groups = [ "ciscosw" ] + vars.parent = "f0sw.openfest.org" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + # vars.specification = "vocsw" + + vars.snmp_uptime = "true" +} diff --git a/monitoring/icinga2/conf.d/hosts/switches/receptionsw.conf b/monitoring/icinga2/conf.d/hosts/switches/receptionsw.conf new file mode 100644 index 0000000..459c3e5 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/switches/receptionsw.conf @@ -0,0 +1,73 @@ +object Host "receptionsw.openfest.org" { + import "generic-host" + + address = "receptionsw" + vars.groups = [ "vocsw" ] + + vars.parent = "coresw.openfest.org" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + # vars.specification = "vocsw" + + # vars.net_interfaces = [ "eth0", "eth1" ] + vars.snmp_ifaces [ "gigabitEthernet 1/0/1" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.1" + value = "1" # UP - 1 , 2 - down + } + + # printer - on usb + vars.snmp_ifaces [ "gigabitEthernet 1/0/2" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.2" + value = "2" + } + + # pc ? + vars.snmp_ifaces [ "gigabitEthernet 1/0/3" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.3" + value = "1|2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/4" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.4" + value = "2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/5" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.5" + value = "2" + } + vars.snmp_ifaces [ "gigabitEthernet 1/0/6" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.6" + value = "2" + } + + # ip camera in reception + vars.snmp_ifaces [ "gigabitEthernet 1/0/7" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.7" + value = "1" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/8" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.8" + value = "1" + } + + + vars.snmp_ifaces [ "gigabitEthernet 1/0/9" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.9" + value = "2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/10" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10" + value = "2" + } + + vars.snmp_uptime = "true" + + vars.notification["slack"] = { + groups = [ "icingaadmins" ] + } +} + diff --git a/monitoring/icinga2/conf.d/hosts/switches/teamsw.conf b/monitoring/icinga2/conf.d/hosts/switches/teamsw.conf new file mode 100644 index 0000000..150a088 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/switches/teamsw.conf @@ -0,0 +1,70 @@ +object Host "teamsw.openfest.org" { + import "generic-host" + + address = "teamsw" + vars.groups = [ "vocsw" ] + + vars.parent = "coresw.openfest.org" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + # vars.specification = "vocsw" + + # vars.net_interfaces = [ "eth0", "eth1" ] + vars.snmp_ifaces [ "gigabitEthernet 1/0/1" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.1" + value = "1" # UP - 1 , 2 - down + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/2" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.2" + value = "1" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/3" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.3" + value = "1|2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/4" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.4" + value = "2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/5" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.5" + value = "2" + } + vars.snmp_ifaces [ "gigabitEthernet 1/0/6" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.6" + value = "2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/7" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.7" + value = "2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/8" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.8" + value = "1" + } + + + vars.snmp_ifaces [ "gigabitEthernet 1/0/9" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.9" + value = "2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/10" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10" + value = "2" + } + + vars.snmp_uptime = "true" + + vars.notification["slack"] = { + groups = [ "icingaadmins" ] + } +} + diff --git a/monitoring/icinga2/conf.d/hosts/switches/uplink-gkc.conf b/monitoring/icinga2/conf.d/hosts/switches/uplink-gkc.conf new file mode 100644 index 0000000..0b1dca3 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/switches/uplink-gkc.conf @@ -0,0 +1,130 @@ +object Host "uplink-gkc.openfest.org" { + import "generic-host" + + address = "uplink-gkc" + vars.groups = [ "vocsw" ] + + vars.parent = "coresw.openfest.org" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + # vars.specification = "vocsw" + + # debug + vars.snmp_ifaces [ "FastEthernet0/1" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10001" + value = "1|2" # UP - 1 , 2 - down + } + + # down + vars.snmp_ifaces [ "FastEthernet0/2" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10002" + value = "2" + } + vars.snmp_ifaces [ "FastEthernet0/3" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10003" + value = "2" + } + vars.snmp_ifaces [ "FastEthernet0/4" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10004" + value = "2" + } + vars.snmp_ifaces [ "FastEthernet0/5" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10005" + value = "2" + } + vars.snmp_ifaces [ "FastEthernet0/6" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10006" + value = "2" + } + vars.snmp_ifaces [ "FastEthernet0/7" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10007" + value = "2" + } + vars.snmp_ifaces [ "FastEthernet0/8" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10008" + value = "2" + } + vars.snmp_ifaces [ "FastEthernet0/9" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10009" + value = "2" + } + vars.snmp_ifaces [ "FastEthernet0/10" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10010" + value = "2" + } + vars.snmp_ifaces [ "FastEthernet0/11" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10011" + value = "2" + } + vars.snmp_ifaces [ "FastEthernet0/12" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10012" + value = "2" + } + vars.snmp_ifaces [ "FastEthernet0/13" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10013" + value = "2" + } + vars.snmp_ifaces [ "FastEthernet0/14" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10014" + value = "2" + } + vars.snmp_ifaces [ "FastEthernet0/15" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10015" + value = "2" + } + vars.snmp_ifaces [ "FastEthernet0/16" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10016" + value = "2" + } + vars.snmp_ifaces [ "FastEthernet0/17" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10017" + value = "2" + } + vars.snmp_ifaces [ "FastEthernet0/18" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10018" + value = "2" + } + vars.snmp_ifaces [ "FastEthernet0/19" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10019" + value = "2" + } + vars.snmp_ifaces [ "FastEthernet0/20" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10020" + value = "2" + } + vars.snmp_ifaces [ "FastEthernet0/21" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10021" + value = "2" + } + vars.snmp_ifaces [ "FastEthernet0/22" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10022" + value = "2" + } + vars.snmp_ifaces [ "FastEthernet0/23" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10023" + value = "2" + } + vars.snmp_ifaces [ "FastEthernet0/24" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10024" + value = "2" + } + + # to gkc - switchboard + vars.snmp_ifaces [ "GigabitEthernet0/1" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10101" + value = "1" + } + + # hall + vars.snmp_ifaces [ "GigabitEthernet0/2" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10102" + value = "1" + } + + vars.notification["slack"] = { + groups = [ "icingaadmins" ] + } + vars.snmp_uptime = "true" +} + diff --git a/monitoring/icinga2/conf.d/hosts/switches/uplink-sw.conf b/monitoring/icinga2/conf.d/hosts/switches/uplink-sw.conf new file mode 100644 index 0000000..777e231 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/switches/uplink-sw.conf @@ -0,0 +1,72 @@ +object Host "uplink-sw.openfest.org" { + import "generic-host" + + address = "uplink-sw" + vars.groups = [ "vocsw" ] + + vars.parent = "uplink-gkc.openfest.org" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + # vars.specification = "vocsw" + + # debug + vars.snmp_ifaces [ "gigabitEthernet 1/0/1" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.1" + value = "2" # UP - 1 , 2 - down + } + + # down + vars.snmp_ifaces [ "gigabitEthernet 1/0/2" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.2" + value = "2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/3" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.3" + value = "2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/4" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.4" + value = "2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/5" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.5" + value = "2" + } + vars.snmp_ifaces [ "gigabitEthernet 1/0/6" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.6" + value = "2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/7" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.7" + value = "2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/8" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.8" + value = "2" + } + + # uplink - ipacct + vars.snmp_ifaces [ "gigabitEthernet 1/0/9" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.9" + value = "1" + } + + # to gkc + vars.snmp_ifaces [ "gigabitEthernet 1/0/10" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10" + value = "1" + } + + vars.snmp_uptime = "true" + + vars.notification["slack"] = { + groups = [ "icingaadmins" ] + } +} + diff --git a/monitoring/icinga2/conf.d/hosts/switches/vocsw-A.conf b/monitoring/icinga2/conf.d/hosts/switches/vocsw-A.conf new file mode 100644 index 0000000..d0991b1 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/switches/vocsw-A.conf @@ -0,0 +1,69 @@ +object Host "vocsw-A.openfest.org" { + import "generic-host" + + address = "vocsw-A" + vars.groups = [ "vocsw" ] + + vars.parent = "coresw.openfest.org" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + # vars.specification = "vocsw" + + vars.snmp_ifaces [ "gigabitEthernet 1/0/1" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.1" + value = "1" # UP - 1 , 2 - down + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/2" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.2" + value = "1" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/3" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.3" + value = "1" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/4" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.4" + value = "1" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/5" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.5" + value = "1|2" + } + vars.snmp_ifaces [ "gigabitEthernet 1/0/6" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.6" + value = "1|2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/7" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.7" + value = "1|2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/8" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.8" + value = "1" + } + + + vars.snmp_ifaces [ "gigabitEthernet 1/0/9" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.9" + value = "2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/10" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10" + value = "2" + } + + vars.snmp_uptime = "true" + + vars.notification["slack"] = { + groups = [ "icingaadmins" ] + } +} + diff --git a/monitoring/icinga2/conf.d/hosts/switches/vocsw-B.conf b/monitoring/icinga2/conf.d/hosts/switches/vocsw-B.conf new file mode 100644 index 0000000..4d87380 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/switches/vocsw-B.conf @@ -0,0 +1,69 @@ +object Host "vocsw-B.openfest.org" { + import "generic-host" + + address = "vocsw-B" + vars.groups = [ "vocsw" ] + + vars.parent = "coresw.openfest.org" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + # vars.specification = "vocsw" + + vars.snmp_ifaces [ "gigabitEthernet 1/0/1" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.1" + value = "1" # UP - 1 , 2 - down + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/2" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.2" + value = "1|2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/3" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.3" + value = "2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/4" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.4" + value = "1" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/5" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.5" + value = "1|2" + } + vars.snmp_ifaces [ "gigabitEthernet 1/0/6" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.6" + value = "1|2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/7" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.7" + value = "1|2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/8" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.8" + value = "1" + } + + + vars.snmp_ifaces [ "gigabitEthernet 1/0/9" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.9" + value = "2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/10" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10" + value = "2" + } + + vars.snmp_uptime = "true" + + vars.notification["slack"] = { + groups = [ "icingaadmins" ] + } +} + diff --git a/monitoring/icinga2/conf.d/hosts/switches/vocsw-C.conf b/monitoring/icinga2/conf.d/hosts/switches/vocsw-C.conf new file mode 100644 index 0000000..01b592f --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/switches/vocsw-C.conf @@ -0,0 +1,71 @@ +object Host "vocsw-C.openfest.org" { + import "generic-host" + + address = "vocsw-C" + vars.groups = [ "vocsw" ] + + vars.parent = "coresw.openfest.org" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + # vars.specification = "vocsw" + + # vars.net_interfaces = [ "eth0", "eth1" ] + vars.snmp_ifaces [ "gigabitEthernet 1/0/1" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.1" + value = "1" # UP - 1 , 2 - down + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/2" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.2" + value = "1" + } + + # cambox - moved to core + vars.snmp_ifaces [ "gigabitEthernet 1/0/3" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.3" + value = "2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/4" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.4" + value = "1" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/5" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.5" + value = "1|2" + } + vars.snmp_ifaces [ "gigabitEthernet 1/0/6" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.6" + value = "1|2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/7" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.7" + value = "1|2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/8" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.8" + value = "1" + } + + + vars.snmp_ifaces [ "gigabitEthernet 1/0/9" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.9" + value = "2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/10" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10" + value = "2" + } + + vars.snmp_uptime = "true" + + vars.notification["slack"] = { + groups = [ "icingaadmins" ] + } +} + diff --git a/monitoring/icinga2/conf.d/hosts/switches/vocsw-D.conf b/monitoring/icinga2/conf.d/hosts/switches/vocsw-D.conf new file mode 100644 index 0000000..eb38deb --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/switches/vocsw-D.conf @@ -0,0 +1,70 @@ +object Host "vocsw-D.openfest.org" { + import "generic-host" + + address = "vocsw-D" + vars.groups = [ "vocsw" ] + + vars.parent = "coresw.openfest.org" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + # vars.specification = "vocsw" + + # vars.net_interfaces = [ "eth0", "eth1" ] + vars.snmp_ifaces [ "gigabitEthernet 1/0/1" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.1" + value = "1" # UP - 1 , 2 - down + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/2" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.2" + value = "1" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/3" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.3" + value = "1" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/4" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.4" + value = "2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/5" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.5" + value = "1|2" + } + vars.snmp_ifaces [ "gigabitEthernet 1/0/6" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.6" + value = "1|2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/7" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.7" + value = "1|2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/8" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.8" + value = "1" + } + + + vars.snmp_ifaces [ "gigabitEthernet 1/0/9" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.9" + value = "2" + } + + vars.snmp_ifaces [ "gigabitEthernet 1/0/10" ] = { + OID = "1.3.6.1.2.1.2.2.1.8.10" + value = "2" + } + + vars.snmp_uptime = "true" + + vars.notification["slack"] = { + groups = [ "icingaadmins" ] + } +} + diff --git a/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-a1.conf b/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-a1.conf new file mode 100644 index 0000000..ef1b451 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-a1.conf @@ -0,0 +1,32 @@ +object Host "ap-cf-a1.openfest.org" { + import "generic-host" + + address = "ap-cf-a1" + vars.groups = [ "openwrt" ] + + vars.parent = "coresw.openfest.org" + + vars.os = "Linux" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + vars.by_ssh_port = "22" + vars.by_ssh_logname = "root" + vars.by_ssh_identity = "/var/lib/nagios/.ssh/id_rsa" + + # vars.specification = "ap" + + vars.net_interfaces = [ "eth0", "eth1" ] + vars.ifaces[ "wlan0" ] = { + interface = "wlan0" + } + + vars.ifaces[ "wlan1" ] = { + interface = "wlan1" + } + + vars.notification["slack"] = { + groups = [ "icingaadmins" ] + } +} + diff --git a/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-a2.conf b/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-a2.conf new file mode 100644 index 0000000..716c63a --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-a2.conf @@ -0,0 +1,32 @@ +object Host "ap-cf-a2.openfest.org" { + import "generic-host" + + address = "ap-cf-a2" + vars.groups = [ "openwrt" ] + + vars.parent = "coresw.openfest.org" + + vars.os = "Linux" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + vars.by_ssh_port = "22" + vars.by_ssh_logname = "root" + vars.by_ssh_identity = "/var/lib/nagios/.ssh/id_rsa" + + # vars.specification = "ap" + + vars.net_interfaces = [ "eth0", "eth1" ] + vars.ifaces[ "wlan0" ] = { + interface = "wlan0" + } + + vars.ifaces[ "wlan1" ] = { + interface = "wlan1" + } + + vars.notification["slack"] = { + groups = [ "icingaadmins" ] + } +} + diff --git a/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-b1.conf b/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-b1.conf new file mode 100644 index 0000000..faf4656 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-b1.conf @@ -0,0 +1,29 @@ +object Host "ap-cf-b1.openfest.org" { + import "generic-host" + + address = "ap-cf-b1" + vars.groups = [ "openwrt" ] + + vars.parent = "coresw.openfest.org" + + vars.os = "Linux" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + vars.by_ssh_port = "22" + vars.by_ssh_logname = "root" + vars.by_ssh_identity = "/var/lib/nagios/.ssh/id_rsa" + + # vars.specification = "ap" + + vars.net_interfaces = [ "eth0", "eth1" ] + + vars.ifaces[ "wlan1" ] = { + interface = "wlan1" + } + + vars.notification["slack"] = { + groups = [ "icingaadmins" ] + } +} + diff --git a/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-c1.conf b/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-c1.conf new file mode 100644 index 0000000..40a9d39 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-c1.conf @@ -0,0 +1,29 @@ +object Host "ap-cf-c1.openfest.org" { + import "generic-host" + + address = "ap-cf-c1" + vars.groups = [ "openwrt" ] + + vars.parent = "coresw.openfest.org" + + vars.os = "Linux" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + vars.by_ssh_port = "22" + vars.by_ssh_logname = "root" + vars.by_ssh_identity = "/var/lib/nagios/.ssh/id_rsa" + + # vars.specification = "ap" + + vars.net_interfaces = [ "eth0", "eth1" ] + + vars.ifaces[ "wlan1" ] = { + interface = "wlan1" + } + + vars.notification["slack"] = { + groups = [ "icingaadmins" ] + } +} + diff --git a/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-ch.conf b/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-ch.conf new file mode 100644 index 0000000..3296481 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-ch.conf @@ -0,0 +1,33 @@ +object Host "ap-cf-ch.openfest.org" { + import "generic-host" + + # ap depends on teamsw + vars.parent = "teamsw.openfest.org" + + address = "ap-cf-ch" + vars.groups = [ "openwrt" ] + + vars.os = "Linux" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + vars.by_ssh_port = "22" + vars.by_ssh_logname = "root" + vars.by_ssh_identity = "/var/lib/nagios/.ssh/id_rsa" + + # vars.specification = "ap" + + vars.net_interfaces = [ "eth0", "eth1" ] + vars.ifaces[ "wlan0" ] = { + interface = "wlan0" + } + + vars.ifaces[ "wlan1" ] = { + interface = "wlan1" + } + + vars.notification["slack"] = { + groups = [ "icingaadmins" ] + } +} + diff --git a/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-f-l.conf b/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-f-l.conf new file mode 100644 index 0000000..82ec3d7 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-f-l.conf @@ -0,0 +1,33 @@ +object Host "ap-cf-f-l.openfest.org" { + import "generic-host" + + address = "ap-cf-f-l" + vars.groups = [ "openwrt" ] + + vars.parent = "coresw.openfest.org" + + + vars.os = "Linux" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + vars.by_ssh_port = "22" + vars.by_ssh_logname = "root" + vars.by_ssh_identity = "/var/lib/nagios/.ssh/id_rsa" + + # vars.specification = "ap" + + vars.net_interfaces = [ "eth0", "eth1" ] + vars.ifaces[ "wlan0" ] = { + interface = "wlan0" + } + + vars.ifaces[ "wlan1" ] = { + interface = "wlan1" + } + + vars.notification["slack"] = { + groups = [ "icingaadmins" ] + } +} + diff --git a/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-f-r.conf b/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-f-r.conf new file mode 100644 index 0000000..e955202 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-f-r.conf @@ -0,0 +1,29 @@ +object Host "ap-cf-f-r.openfest.org" { + import "generic-host" + + address = "ap-cf-f-r" + vars.groups = [ "openwrt" ] + + vars.parent = "coresw.openfest.org" + + vars.os = "Linux" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + vars.by_ssh_port = "22" + vars.by_ssh_logname = "root" + vars.by_ssh_identity = "/var/lib/nagios/.ssh/id_rsa" + + # vars.specification = "ap" + + vars.net_interfaces = [ "eth0", "eth1" ] + + vars.ifaces[ "wlan1" ] = { + interface = "wlan1" + } + + vars.notification["slack"] = { + groups = [ "icingaadmins" ] + } +} + diff --git a/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-qws.conf b/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-qws.conf new file mode 100644 index 0000000..077d35c --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-qws.conf @@ -0,0 +1,32 @@ +object Host "ap-cf-qws.openfest.org" { + import "generic-host" + + address = "ap-cf-qws" + vars.groups = [ "openwrt" ] + + vars.parent = "coresw.openfest.org" + + vars.os = "Linux" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + vars.by_ssh_port = "22" + vars.by_ssh_logname = "root" + vars.by_ssh_identity = "/var/lib/nagios/.ssh/id_rsa" + + # vars.specification = "ap" + + vars.net_interfaces = [ "eth0", "eth1" ] + vars.ifaces[ "wlan0" ] = { + interface = "wlan0" + } + + vars.ifaces[ "wlan1" ] = { + interface = "wlan1" + } + + vars.notification["slack"] = { + groups = [ "icingaadmins" ] + } +} + diff --git a/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-srv.conf b/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-srv.conf new file mode 100644 index 0000000..73fab8c --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-cf-srv.conf @@ -0,0 +1,32 @@ +object Host "ap-cf-srv.openfest.org" { + import "generic-host" + + address = "ap-cf-srv" + vars.groups = [ "openwrt" ] + + vars.parent = "coresw.openfest.org" + + vars.os = "Linux" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + vars.by_ssh_port = "22" + vars.by_ssh_logname = "root" + vars.by_ssh_identity = "/var/lib/nagios/.ssh/id_rsa" + + # vars.specification = "ap" + + vars.net_interfaces = [ "eth0", "eth1" ] + vars.ifaces[ "wlan0" ] = { + interface = "wlan0" + } + + vars.ifaces[ "wlan1" ] = { + interface = "wlan1" + } + + vars.notification["slack"] = { + groups = [ "icingaadmins" ] + } +} + diff --git a/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-ws-noc.conf b/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-ws-noc.conf new file mode 100644 index 0000000..019898a --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-ws-noc.conf @@ -0,0 +1,29 @@ +object Host "ap-ws-noc.openfest.org" { + import "generic-host" + + address = "ap-ws-noc" + vars.groups = [ "openwrt" ] + + vars.parent = "nocsw.openfest.org" + + vars.os = "Linux" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + vars.by_ssh_port = "22" + vars.by_ssh_logname = "root" + vars.by_ssh_identity = "/var/lib/nagios/.ssh/id_rsa" + + # vars.specification = "ap" + + vars.net_interfaces = [ "eth0", "eth1" ] + + vars.ifaces[ "wlan1" ] = { + interface = "wlan1" + } + + vars.notification["slack"] = { + groups = [ "icingaadmins" ] + } +} + diff --git a/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-ws-ws1.conf b/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-ws-ws1.conf new file mode 100644 index 0000000..10d7fbf --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-ws-ws1.conf @@ -0,0 +1,33 @@ +object Host "ap-ws-ws1.openfest.org" { + import "generic-host" + + # depends on f0sw + vars.parent = "f0sw.openfest.org" + + address = "ap-ws-ws1" + vars.groups = [ "openwrt" ] + + vars.os = "Linux" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + vars.by_ssh_port = "22" + vars.by_ssh_logname = "root" + vars.by_ssh_identity = "/var/lib/nagios/.ssh/id_rsa" + + # vars.specification = "ap" + + vars.net_interfaces = [ "eth0", "eth1" ] + vars.ifaces[ "wlan0" ] = { + interface = "wlan0" + } + + vars.ifaces[ "wlan1" ] = { + interface = "wlan1" + } + + vars.notification["slack"] = { + groups = [ "icingaadmins" ] + } +} + diff --git a/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-ws-ws2.conf b/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-ws-ws2.conf new file mode 100644 index 0000000..24a7936 --- /dev/null +++ b/monitoring/icinga2/conf.d/hosts/wifi/openwrt-ap-ws-ws2.conf @@ -0,0 +1,33 @@ +object Host "ap-ws-ws2.openfest.org" { + import "generic-host" + + # depends on f0sw + vars.parent = "f0sw.openfest.org" + + address = "ap-ws-ws2" + vars.groups = [ "openwrt" ] + + vars.os = "Linux" + + # check_command = "xxx_health" + # vars.extra_port_check = "" + vars.by_ssh_port = "22" + vars.by_ssh_logname = "root" + vars.by_ssh_identity = "/var/lib/nagios/.ssh/id_rsa" + + # vars.specification = "ap" + + vars.net_interfaces = [ "eth0", "eth1" ] + vars.ifaces[ "wlan0" ] = { + interface = "wlan0" + } + + vars.ifaces[ "wlan1" ] = { + interface = "wlan1" + } + + vars.notification["slack"] = { + groups = [ "icingaadmins" ] + } +} + diff --git a/monitoring/icinga2/conf.d/notifications.conf b/monitoring/icinga2/conf.d/notifications.conf new file mode 100644 index 0000000..036918d --- /dev/null +++ b/monitoring/icinga2/conf.d/notifications.conf @@ -0,0 +1,42 @@ +/** + * The example notification apply rules. + * + * Only applied if host/service objects have + * the custom variable `notification` defined + * and containing `mail` as key. + * + * Check `hosts.conf` for an example. + */ + +#apply Notification "mail-icingaadmin" to Host { +# import "mail-host-notification" +# user_groups = host.vars.notification.mail.groups +# users = host.vars.notification.mail.users + + //interval = 2h + + //vars.notification_logtosyslog = true + +# assign where host.vars.notification.mail +#} + +//apply Notification "mail-icingaadmin" to Service { +// import "mail-service-notification" +// user_groups = host.vars.notification.mail.groups +// users = host.vars.notification.mail.users + + //interval = 2h + + //vars.notification_logtosyslog = true + +// assign where host.vars.notification.mail +//} + +apply Notification "slack" to Service { + import "slack-service-notification" + user_groups = host.vars.notification.slack.groups + interval = 10m + vars.notification_logtosyslog = true + assign where host.vars.notification.slack +} + diff --git a/monitoring/icinga2/conf.d/satellite.conf b/monitoring/icinga2/conf.d/satellite.conf new file mode 100644 index 0000000..4a6b97a --- /dev/null +++ b/monitoring/icinga2/conf.d/satellite.conf @@ -0,0 +1,33 @@ +/* + * Host and Service templates for the Agent Setup. + */ + + +/** + * Provides settings for satellite hosts managed by 'icinga2 repository'. + * Define your global attributes here, for example custom + * attributes used for notifications, etc. + */ +template Host "satellite-host" { + vars.notification["mail"] = { + groups = [ "icingaadmins" ] + } +} + +/** + * Provides settings for satellite services managed by 'icinga2 repository'. + * Define your global satellite attributes here, for example custom + * attributes used for notifications, etc. + */ +template Service "satellite-service" { + vars.notification["mail"] = { + groups = [ "icingaadmins" ] + } +} + + +apply Dependency "satellite-host" to Host { + parent_host_name = host.zone + + assign where host.zone != "" && "satellite-host" in host.templates +} diff --git a/monitoring/icinga2/conf.d/services-new.conf b/monitoring/icinga2/conf.d/services-new.conf new file mode 100644 index 0000000..7c295c9 --- /dev/null +++ b/monitoring/icinga2/conf.d/services-new.conf @@ -0,0 +1,137 @@ +apply Service "network_interfaces_traffic" { + import "generic-service" + check_interval = 5m + retry_interval = 1m + max_check_attempts = 3 + check_command = "check_net_int" + vars.int_warn="925" + vars.int_crit="950" + enable_perfdata = true + + assign where host.vars.net_interfaces + + vars.notif_prio = "high" +} + +apply Service "network_open_ports" { + import "generic-service" + max_check_attempts = 3 + check_interval = 5m + retry_interval = 1m + check_command = "check_open_ports" + vars.ports=host.vars.open_ports + vars.host=host.address + assign where host.vars.open_ports + + vars.notif_prio = "high" +} + +apply Service for (iface => config in host.vars.ifaces) { + import "generic-service" + display_name = "bandwidth_" + iface + + check_command = "check_bandwidth" + + vars += config + # NB: you probably want to use another condition/hostgroup + assign where "openwrt" in host.vars.groups +} + +apply Service for (iface => config in host.vars.snmp_ifaces) { + import "generic-service" + display_name = "operstatus_" + iface + + check_command = "check_operstatus" + + vars.host = host.address + vars += config + # NB: you probably want to use another condition/hostgroup + assign where "vocsw" in host.vars.groups + assign where "ciscosw" in host.vars.groups +} + +apply Service "uptime-tp" { + display_name = "Uptime" + import "generic-service" + check_command = "snmp" + vars.snmp_oid = "1.3.6.1.2.1.1.3.0" + vars.snmp_community = "openfest" + assign where "vocsw" in host.vars.groups && host.vars.snmp_uptime +} + +apply Service "uptime-cisco" { + display_name = "Uptime" + import "generic-service" + check_command = "snmp" + vars.snmp_oid = "1.3.6.1.6.3.10.2.1.3.0" + vars.snmp_community = "openfest" + vars.snmp_miblist = "SNMP-FRAMEWORK-MIB" + assign where "ciscosw" in host.vars.groups && host.vars.snmp_uptime +} + +apply Service "poe-watts-remaining" { + display_name = "POE - Watts Remaining" + import "generic-service" + check_command = "cisco-poe-check" + assign where host.name == "coresw.openfest.org" +} + +apply Service for (stream => config in host.vars.rtmp_check) { + import "generic-service" + display_name = "RTMP Check " + stream + check_command = "rtmp-check" + + vars += config + +### assign where host.name == "vin-external.openfest.org" + assign where host.vars.rtmp_check +} + +apply Service "bird_bgp_sessions" { + import "generic-service" + max_check_attempts = 3 + check_interval = 5m + retry_interval = 1m + check_command = "bgp_sessions_check" + vars.ASN = host.vars.ASN + vars.sessions_down = host.vars.sessions_down + assign where host.vars.ASN + + vars.notif_prio = "high" +} + +apply Service "check_sensors" { + import "generic-service" + display_name = "Check LM Sensors " + check_command = "check_sensors" +### vars += config + + assign where host.name == "vin-external.openfest.org" +} + +apply Service "check_unbound" { + import "generic-service" + display_name = "Check Unbound Status" + check_command = "check_unbound" + assign where host.name == "vin-external.openfest.org" +} + +apply Service for (ups_check => config in host.vars.ups) { + import "generic-service" + display_name = "UPS " + ups_check + check_command = "check_ups" + + vars.host = host.address + vars += config + + assign where host.vars.ups +} + +apply Service for (stream => config in host.vars.audiostream_check) { + import "generic-service" + display_name = "Stream check " + stream + check_command = "check-audio-stream" + vars += config + + assign where host.vars.audiostream_check +} diff --git a/monitoring/icinga2/conf.d/services.conf b/monitoring/icinga2/conf.d/services.conf new file mode 100644 index 0000000..665034a --- /dev/null +++ b/monitoring/icinga2/conf.d/services.conf @@ -0,0 +1,116 @@ +/* + * Service apply rules. + * + * The CheckCommand objects `ping4`, `ping6`, etc + * are provided by the plugin check command templates. + * Check the documentation for details. + * + * Tip: Use `icinga2 object list --type Service` to + * list all service objects after running + * configuration validation (`icinga2 daemon -C`). + */ + +/* + * This is an example host based on your + * local host's FQDN. Specify the NodeName + * constant in `constants.conf` or use your + * own description, e.g. "db-host-1". + */ + +/* + * These are generic `ping4` and `ping6` + * checks applied to all hosts having the + * `address` resp. `address6` attribute + * defined. + */ +apply Service "ping4" { + import "generic-service" + + check_command = "ping4" + assign where host.address +} + +apply Service "ping6" { + import "generic-service" + + check_command = "ping6" + + assign where host.address6 +} + +/* + * Apply the `ssh` service to all hosts + * with the `address` attribute defined and + * the custom variable `os` set to `Linux`. + */ +apply Service "ssh" { + import "generic-service" + + check_command = "ssh" + + assign where (host.address || host.address6) && host.vars.os == "Linux" +} + + + +apply Service for (http_vhost => config in host.vars.http_vhosts) { + import "generic-service" + + check_command = "http" + + vars += config +} + +apply Service for (disk => config in host.vars.disks) { + import "generic-service" + + check_command = "disk" + + vars += config +} + +apply Service "icinga" { + import "generic-service" + + check_command = "icinga" + + assign where host.name == NodeName +} + +apply Service "load" { + import "generic-service" + + check_command = "load" + + /* Used by the ScheduledDowntime apply rule in `downtimes.conf`. */ + vars.backup_downtime = "02:00-03:00" + + assign where host.name == NodeName +} + +apply Service "procs" { + import "generic-service" + + check_command = "procs" + + assign where host.name == NodeName +} + +apply Service "swap" { + import "generic-service" + + check_command = "swap" + + assign where host.vars.swap_size +} + +apply Service "users" { + import "generic-service" + + check_command = "users" + + assign where host.name == NodeName +} + + + diff --git a/monitoring/icinga2/conf.d/slack-service-notification-command.conf b/monitoring/icinga2/conf.d/slack-service-notification-command.conf new file mode 100644 index 0000000..99c525e --- /dev/null +++ b/monitoring/icinga2/conf.d/slack-service-notification-command.conf @@ -0,0 +1,20 @@ +object NotificationCommand "slack-service-notification" { + import "plugin-notification-command" + + command = [ SysconfDir + "/icinga2/scripts/slack-service-notification.sh" ] + + env = { + "NOTIFICATIONTYPE" = "$notification.type$" + "SERVICEDESC" = "$service.name$" + "HOSTALIAS" = "$host.display_name$", + "HOSTNAME" = "$host.name$", + "HOSTADDRESS" = "$address$", + "SERVICESTATE" = "$service.state$", + "LONGDATETIME" = "$icinga.long_date_time$", + "SERVICEOUTPUT" = "$service.output$", + "NOTIFICATIONAUTHORNAME" = "$notification.author$", + "NOTIFICATIONCOMMENT" = "$notification.comment$", + "HOSTDISPLAYNAME" = "$host.display_name$", + "SERVICEDISPLAYNAME" = "$service.display_name$", + } +} diff --git a/monitoring/icinga2/conf.d/slack-service-notification.conf b/monitoring/icinga2/conf.d/slack-service-notification.conf new file mode 100644 index 0000000..4bbb6d4 --- /dev/null +++ b/monitoring/icinga2/conf.d/slack-service-notification.conf @@ -0,0 +1,10 @@ +template Notification "slack-service-notification" { + command = "slack-service-notification" + + states = [ OK, Warning, Critical, Unknown ] + types = [ Problem, Acknowledgement, Recovery, Custom, + FlappingStart, FlappingEnd, + DowntimeStart, DowntimeEnd, DowntimeRemoved ] + + period = "24x7" +} diff --git a/monitoring/icinga2/conf.d/templates.conf b/monitoring/icinga2/conf.d/templates.conf new file mode 100644 index 0000000..5655e3f --- /dev/null +++ b/monitoring/icinga2/conf.d/templates.conf @@ -0,0 +1,83 @@ +/* + * Generic template examples. + */ + + +/** + * Provides default settings for hosts. By convention + * all hosts should import this template. + * + * The CheckCommand object `hostalive` is provided by + * the plugin check command templates. + * Check the documentation for details. + */ +template Host "generic-host" { + max_check_attempts = 3 + check_interval = 1m + retry_interval = 30s + + check_command = "hostalive" +} + +/** + * Provides default settings for services. By convention + * all services should import this template. + */ +template Service "generic-service" { + max_check_attempts = 5 + check_interval = 1m + retry_interval = 30s +} + +/** + * Provides default settings for users. By convention + * all users should inherit from this template. + */ + +template User "generic-user" { + +} + +/** + * Provides default settings for host notifications. + * By convention all host notifications should import + * this template. + */ +template Notification "mail-host-notification" { + command = "mail-host-notification" + + states = [ Up, Down ] + types = [ Problem, Acknowledgement, Recovery, Custom, + FlappingStart, FlappingEnd, + DowntimeStart, DowntimeEnd, DowntimeRemoved ] + + vars += { + // notification_icingaweb2url = "https://www.example.com/icingaweb2" + // notification_from = "Icinga 2 Host Monitoring " + notification_logtosyslog = false + } + + period = "24x7" +} + +/** + * Provides default settings for service notifications. + * By convention all service notifications should import + * this template. + */ +template Notification "mail-service-notification" { + command = "mail-service-notification" + + states = [ OK, Warning, Critical, Unknown ] + types = [ Problem, Acknowledgement, Recovery, Custom, + FlappingStart, FlappingEnd, + DowntimeStart, DowntimeEnd, DowntimeRemoved ] + + vars += { + // notification_icingaweb2url = "https://www.example.com/icingaweb2" + // notification_from = "Icinga 2 Service Monitoring " + notification_logtosyslog = false + } + + period = "24x7" +} diff --git a/monitoring/icinga2/conf.d/timeperiods.conf b/monitoring/icinga2/conf.d/timeperiods.conf new file mode 100644 index 0000000..ea162ff --- /dev/null +++ b/monitoring/icinga2/conf.d/timeperiods.conf @@ -0,0 +1,35 @@ +/** + * Sample timeperiods for Icinga 2. + * Check the documentation for details. + */ + +object TimePeriod "24x7" { + display_name = "Icinga 2 24x7 TimePeriod" + ranges = { + "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" + "sunday" = "00:00-24:00" + } +} + +object TimePeriod "9to5" { + display_name = "Icinga 2 9to5 TimePeriod" + ranges = { + "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" + } +} + +object TimePeriod "never" { + display_name = "Icinga 2 never TimePeriod" + ranges = { + } +} + diff --git a/monitoring/icinga2/conf.d/users.conf b/monitoring/icinga2/conf.d/users.conf new file mode 100644 index 0000000..aa31e27 --- /dev/null +++ b/monitoring/icinga2/conf.d/users.conf @@ -0,0 +1,17 @@ +/** + * The example user 'icingaadmin' and the example + * group 'icingaadmins'. + */ + +object User "icingaadmin" { + import "generic-user" + + display_name = "Icinga 2 Admin" + groups = [ "icingaadmins" ] + + email = "root@localhost" +} + +object UserGroup "icingaadmins" { + display_name = "Icinga 2 Admin Group" +} diff --git a/monitoring/icinga2/constants.conf b/monitoring/icinga2/constants.conf new file mode 100644 index 0000000..201362e --- /dev/null +++ b/monitoring/icinga2/constants.conf @@ -0,0 +1,31 @@ +/** + * This file defines global constants which can be used in + * the other configuration files. + */ + +/* XXX: Nice comment */ +const SysconfDir = "/etc" + +/* The directory which contains the plugins from the Monitoring Plugins project. */ +const PluginDir = "/usr/lib/nagios/plugins" + +/* The directory which contains the Manubulon plugins. + * Check the documentation, chapter "SNMP Manubulon Plugin Check Commands", for details. + */ +const ManubulonPluginDir = "/usr/lib/nagios/plugins" + +/* The directory which you use to store additional plugins which ITL provides user contributed command definitions for. + * Check the documentation, chapter "Plugins Contribution", for details. + */ +const PluginContribDir = "/usr/lib/nagios/plugins" + +/* Our local instance name. By default this is the server's hostname as returned by `hostname --fqdn`. + * This should be the common name from the API certificate. + */ +const NodeName = "vin.openfest.org" + +/* Our local zone name. */ +const ZoneName = "vin.openfest.org" + +/* Secret key for remote node tickets */ +const TicketSalt = "" diff --git a/monitoring/icinga2/constants.conf.orig b/monitoring/icinga2/constants.conf.orig new file mode 100644 index 0000000..29232d6 --- /dev/null +++ b/monitoring/icinga2/constants.conf.orig @@ -0,0 +1,28 @@ +/** + * This file defines global constants which can be used in + * the other configuration files. + */ + +/* The directory which contains the plugins from the Monitoring Plugins project. */ +const PluginDir = "/usr/lib/nagios/plugins" + +/* The directory which contains the Manubulon plugins. + * Check the documentation, chapter "SNMP Manubulon Plugin Check Commands", for details. + */ +const ManubulonPluginDir = "/usr/lib/nagios/plugins" + +/* The directory which you use to store additional plugins which ITL provides user contributed command definitions for. + * Check the documentation, chapter "Plugins Contribution", for details. + */ +const PluginContribDir = "/usr/lib/nagios/plugins" + +/* Our local instance name. By default this is the server's hostname as returned by `hostname --fqdn`. + * This should be the common name from the API certificate. + */ +//const NodeName = "localhost" + +/* Our local zone name. */ +const ZoneName = NodeName + +/* Secret key for remote node tickets */ +const TicketSalt = "" diff --git a/monitoring/icinga2/features-enabled/checker.conf b/monitoring/icinga2/features-enabled/checker.conf new file mode 100644 index 0000000..6f003b8 --- /dev/null +++ b/monitoring/icinga2/features-enabled/checker.conf @@ -0,0 +1,5 @@ +/** + * The checker component takes care of executing service checks. + */ + +object CheckerComponent "checker" { } diff --git a/monitoring/icinga2/features-enabled/command.conf b/monitoring/icinga2/features-enabled/command.conf new file mode 100644 index 0000000..ffdd143 --- /dev/null +++ b/monitoring/icinga2/features-enabled/command.conf @@ -0,0 +1,7 @@ +/** + * The ExternalCommandListener implements support for the external + * commands pipe. + */ + +object ExternalCommandListener "command" { } + diff --git a/monitoring/icinga2/features-enabled/graphite.conf b/monitoring/icinga2/features-enabled/graphite.conf new file mode 100644 index 0000000..8f084d2 --- /dev/null +++ b/monitoring/icinga2/features-enabled/graphite.conf @@ -0,0 +1,12 @@ +/** + * The GraphiteWriter type writes check result metrics and + * performance data to a graphite tcp socket. + */ + +library "perfdata" + +object GraphiteWriter "graphite" { +// host = "127.0.0.1" +// port = 2003 +// enable_send_thresholds = true +} diff --git a/monitoring/icinga2/features-enabled/ido-mysql.conf b/monitoring/icinga2/features-enabled/ido-mysql.conf new file mode 100644 index 0000000..eee072d --- /dev/null +++ b/monitoring/icinga2/features-enabled/ido-mysql.conf @@ -0,0 +1,14 @@ +/** + * The db_ido_mysql library implements IDO functionality + * for MySQL. + */ + +library "db_ido_mysql" + +object IdoMysqlConnection "ido-mysql" { + user = "user", + password = "pass", + host = "localhost", + database = "icinga2" +} + diff --git a/monitoring/icinga2/features-enabled/mainlog.conf b/monitoring/icinga2/features-enabled/mainlog.conf new file mode 100644 index 0000000..a3bb19d --- /dev/null +++ b/monitoring/icinga2/features-enabled/mainlog.conf @@ -0,0 +1,8 @@ +/** + * The FileLogger type writes log information to a file. + */ + +object FileLogger "main-log" { + severity = "information" + path = LogDir + "/icinga2.log" +} diff --git a/monitoring/icinga2/features-enabled/notification.conf b/monitoring/icinga2/features-enabled/notification.conf new file mode 100644 index 0000000..3f9a88e --- /dev/null +++ b/monitoring/icinga2/features-enabled/notification.conf @@ -0,0 +1,5 @@ +/** + * The notification component is responsible for sending notifications. + */ + +object NotificationComponent "notification" { } diff --git a/monitoring/icinga2/features-enabled/perfdata.conf b/monitoring/icinga2/features-enabled/perfdata.conf new file mode 100644 index 0000000..3ba8635 --- /dev/null +++ b/monitoring/icinga2/features-enabled/perfdata.conf @@ -0,0 +1,6 @@ +/** + * The PerfdataWriter type writes performance data files and rotates + * them in a regular interval. + */ + +object PerfdataWriter "perfdata" { } diff --git a/monitoring/icinga2/icinga2.conf b/monitoring/icinga2/icinga2.conf new file mode 100644 index 0000000..d583d0c --- /dev/null +++ b/monitoring/icinga2/icinga2.conf @@ -0,0 +1,57 @@ +/** + * Icinga 2 configuration file + * - this is where you define settings for the Icinga application including + * which hosts/services to check. + * + * For an overview of all available configuration options please refer + * to the documentation that is distributed as part of Icinga 2. + */ + +/** + * The constants.conf defines global constants. + */ +include "constants.conf" + +/** + * The zones.conf defines zones for a cluster setup. + * Not required for single instance setups. +include "zones.conf" + */ + +/** + * The Icinga Template Library (ITL) provides a number of useful templates + * and command definitions. + * Common monitoring plugin command definitions are included separately. + */ +include +include +include +include + +/** + * This includes the Icinga 2 Windows plugins. These command definitions + * are required on a master node when a client is used as command endpoint. +include + */ + +/** + * This includes the NSClient++ check commands. These command definitions + * are required on a master node when a client is used as command endpoint. + */ +include + +/** + * The features-available directory contains a number of configuration + * files for features which can be enabled and disabled using the + * icinga2 feature enable / icinga2 feature disable CLI commands. + * These commands work by creating and removing symbolic links in + * the features-enabled directory. + */ +include "features-enabled/*.conf" + +/** + * Although in theory you could define all your objects in this file + * the preferred way is to create separate directories and files in the conf.d + * directory. Each of these files must have the file extension ".conf". + */ +include_recursive "conf.d" diff --git a/monitoring/icinga2/init.conf b/monitoring/icinga2/init.conf new file mode 100644 index 0000000..16a9041 --- /dev/null +++ b/monitoring/icinga2/init.conf @@ -0,0 +1,7 @@ +/** + * This file is read by Icinga 2 before the main + * configuration file (icinga2.conf) is processed. + */ + +const RunAsUser = "nagios" +const RunAsGroup = "nagios" diff --git a/monitoring/icinga2/repository.d/README b/monitoring/icinga2/repository.d/README new file mode 100644 index 0000000..a5da082 --- /dev/null +++ b/monitoring/icinga2/repository.d/README @@ -0,0 +1,3 @@ +This directory contains configuration files managed by 'icinga2 repository' +cli commands. Please run 'icinga2 repository --help' to see all available +options. diff --git a/monitoring/icinga2/scripts/check_nwc_health.pl b/monitoring/icinga2/scripts/check_nwc_health.pl new file mode 100644 index 0000000..1090d53 --- /dev/null +++ b/monitoring/icinga2/scripts/check_nwc_health.pl @@ -0,0 +1,591 @@ +# /usr/bin/perl -w + +use strict; +no warnings qw(once); + +if ( ! grep /BEGIN/, keys %Monitoring::GLPlugin::) { + eval { + require Monitoring::GLPlugin; + require Monitoring::GLPlugin::SNMP; + require Monitoring::GLPlugin::UPNP; + }; + if ($@) { + printf "UNKNOWN - module Monitoring::GLPlugin was not found. Either build a standalone version of this plugin or set PERL5LIB\n"; + printf "%s\n", $@; + exit 3; + } +} + +my $plugin = Classes::Device->new( + shortname => '', + usage => 'Usage: %s [ -v|--verbose ] [ -t ] '. + '--mode '. + '--hostname --community '. + ' ...]', + version => '$Revision: #PACKAGE_VERSION# $', + blurb => 'This plugin checks various parameters of network components ', + url => 'http://labs.consol.de/nagios/check_nwc_health', + timeout => 60, + plugin => $Monitoring::GLPlugin::pluginname, +); +$plugin->add_mode( + internal => 'device::hardware::health', + spec => 'hardware-health', + alias => undef, + help => 'Check the status of environmental equipment (fans, temperatures, power)', +); +$plugin->add_mode( + internal => 'device::hardware::load', + spec => 'cpu-load', + alias => ['cpu-usage'], + help => 'Check the CPU load of the device', +); +$plugin->add_mode( + internal => 'device::hardware::memory', + spec => 'memory-usage', + alias => undef, + help => 'Check the memory usage of the device', +); +$plugin->add_mode( + internal => 'device::disk::usage', + spec => 'disk-usage', + alias => undef, + help => 'Check the disk usage of the device', +); +$plugin->add_mode( + internal => 'device::interfaces::usage', + spec => 'interface-usage', + alias => undef, + help => 'Check the utilization of interfaces', +); +$plugin->add_mode( + internal => 'device::interfaces::errors', + spec => 'interface-errors', + alias => undef, + help => 'Check the error-rate of interfaces (without discards)', +); +$plugin->add_mode( + internal => 'device::interfaces::discards', + spec => 'interface-discards', + alias => undef, + help => 'Check the discard-rate of interfaces', +); +$plugin->add_mode( + internal => 'device::interfaces::operstatus', + spec => 'interface-status', + alias => undef, + help => 'Check the status of interfaces (oper/admin)', +); +$plugin->add_mode( + internal => 'device::interfaces::duplex', + spec => 'interface-duplex', + alias => undef, + help => 'Check if interfaces operate in duplex mode', +); +$plugin->add_mode( + internal => 'device::interfaces::complete', + spec => 'interface-health', + alias => undef, + help => 'Check everything interface', +); +$plugin->add_mode( + internal => 'device::interfaces::nat::sessions::count', + spec => 'interface-nat-count-sessions', + alias => undef, + help => 'Count the number of nat sessions', +); +$plugin->add_mode( + internal => 'device::interfaces::nat::rejects', + spec => 'interface-nat-rejects', + alias => undef, + help => 'Count the number of nat sessions rejected due to lack of resources', +); +$plugin->add_mode( + internal => 'device::interfaces::list', + spec => 'list-interfaces', + alias => undef, + help => 'Show the interfaces of the device and update the name cache', +); +$plugin->add_mode( + internal => 'device::interfaces::listdetail', + spec => 'list-interfaces-detail', + alias => undef, + help => 'Show the interfaces of the device and some details', +); +$plugin->add_mode( + internal => 'device::interfaces::availability', + spec => 'interface-availability', + alias => undef, + help => 'Show the availability (oper != up) of interfaces', +); +$plugin->add_mode( + internal => 'device::interfaces::aggregation::availability', + spec => 'link-aggregation-availability', + alias => undef, + help => 'Check the percentage of up interfaces in a link aggregation', +); +$plugin->add_mode( + internal => 'device::interfaces::ifstack::status', + spec => 'interface-stack-status', + alias => undef, + help => 'Check the status of interface sublayers (mostly layer 2)', +); +$plugin->add_mode( + internal => 'device::interfaces::ifstack::availability', + spec => 'interface-stack-availability', + alias => undef, + help => 'Check the percentage of available sublayer interfaces', +); +$plugin->add_mode( + internal => 'device::interfaces::etherstats', + spec => 'interface-etherstats', + alias => undef, + help => 'Check the ethernet statistics of interfaces', +); +$plugin->add_mode( + internal => 'device::interfaces::uptime', + spec => 'interface-uptime', + alias => undef, + help => 'Check state changes of interfaces', +); +$plugin->add_mode( + internal => 'device::interfaces::portsecurity', + spec => 'interface-security', + alias => undef, + help => 'Check interfaces for security violations', +); +$plugin->add_mode( + internal => 'device::routes::list', + spec => 'list-routes', + alias => undef, + help => 'Show the configured routes', + help => 'Check the percentage of up interfaces in a link aggregation', +); +$plugin->add_mode( + internal => 'device::routes::exists', + spec => 'route-exists', + alias => undef, + help => 'Check if a route exists. (--name is the dest, --name2 check also the next hop)', +); +$plugin->add_mode( + internal => 'device::routes::count', + spec => 'count-routes', + alias => undef, + help => 'Count the routes. (--name is the dest, --name2 is the hop)', +); +$plugin->add_mode( + internal => 'device::vpn::status', + spec => 'vpn-status', + alias => undef, + help => 'Check the status of vpns (up/down)', +); +$plugin->add_mode( + internal => 'device::fcinterfaces::usage', + spec => 'fc-interface-usage', + alias => undef, + help => 'Check the utilization of fibrechannel interfaces', +); +$plugin->add_mode( + internal => 'device::fcinterfaces::errors', + spec => 'fc-interface-errors', + alias => undef, + help => 'Check the error-rate of fibrechannel interfaces', +); +$plugin->add_mode( + internal => 'device::fcinterfaces::discards', + spec => 'fc-interface-discards', + alias => undef, + help => 'Check the discard-rate of interfaces', +); +$plugin->add_mode( + internal => 'device::fcinterfaces::operstatus', + spec => 'fc-interface-status', + alias => undef, + help => 'Check the status of interfaces (oper/admin)', +); +$plugin->add_mode( + internal => 'device::fcinterfaces::complete', + spec => 'fc-interface-health', + alias => undef, + help => 'Check everything interface', +); +$plugin->add_mode( + internal => 'device::fcinterfaces::list', + spec => 'fc-list-interfaces', + alias => undef, + help => 'Show the fcal interfaces of the device and update the name cache', +); +$plugin->add_mode( + internal => 'device::shinken::interface', + spec => 'create-shinken-service', + alias => undef, + help => 'Create a Shinken service definition', +); +$plugin->add_mode( + internal => 'device::hsrp::state', + spec => 'hsrp-state', + alias => undef, + help => 'Check the state in a HSRP group', +); +$plugin->add_mode( + internal => 'device::hsrp::failover', + spec => 'hsrp-failover', + alias => undef, + help => 'Check if a HSRP group\'s nodes have changed their roles', +); +$plugin->add_mode( + internal => 'device::hsrp::list', + spec => 'list-hsrp-groups', + alias => undef, + help => 'Show the HSRP groups configured on this device', +); +$plugin->add_mode( + internal => 'device::vrrp::state', + spec => 'vrrp-state', + alias => undef, + help => 'Check the state in a VRRP group', +); +$plugin->add_mode( + internal => 'device::vrrp::failover', + spec => 'vrrp-failover', + alias => undef, + help => 'Check if a VRRP group\'s nodes have changed their roles', +); +$plugin->add_mode( + internal => 'device::vrrp::list', + spec => 'list-vrrp-groups', + alias => undef, + help => 'Show the VRRP groups configured on this device', +); +$plugin->add_mode( + internal => 'device::bgp::peer::status', + spec => 'bgp-peer-status', + alias => undef, + help => 'Check status of BGP peers', +); +$plugin->add_mode( + internal => 'device::bgp::peer::count', + spec => 'count-bgp-peers', + alias => undef, + help => 'Count the number of BGP peers', +); +$plugin->add_mode( + internal => 'device::bgp::peer::watch', + spec => 'watch-bgp-peers', + alias => undef, + help => 'Watch BGP peers appear and disappear', +); +$plugin->add_mode( + internal => 'device::bgp::peer::list', + spec => 'list-bgp-peers', + alias => undef, + help => 'Show BGP peers known to this device', +); +$plugin->add_mode( + internal => 'device::bgp::prefix::count', + spec => 'count-bgp-prefixes', + alias => undef, + help => 'Count the number of BGP prefixes (for specific peer with --name)', +); +$plugin->add_mode( + internal => 'device::ospf::neighbor::status', + spec => 'ospf-neighbor-status', + alias => undef, + help => 'Check status of OSPF neighbors', +); +$plugin->add_mode( + internal => 'device::ospf::neighbor::watch', + spec => 'watch-ospf-neighbors', + alias => undef, + help => 'Watch OSPF neighbors appear and disappear', +); +$plugin->add_mode( + internal => 'device::ospf::neighbor::list', + spec => 'list-ospf-neighbors', + alias => undef, + help => 'Show OSPF neighbors', +); +$plugin->add_mode( + internal => 'device::eigrp::peer::count', + spec => 'count-eigrp-peers', + alias => undef, + help => 'Count the number of EIGRP peers', +); +$plugin->add_mode( + internal => 'device::eigrp::peer::status', + spec => 'eigrp-peer-status', + alias => undef, + help => 'Check status (existance) of EIGRP peers', +); +$plugin->add_mode( + internal => 'device::eigrp::peer::watch', + spec => 'watch-eigrp-peers', + alias => undef, + help => 'Watch EIGRP peers appear and disappear', +); +$plugin->add_mode( + internal => 'device::eigrp::peer::list', + spec => 'list-eigrp-peers', + alias => undef, + help => 'Show EIGRP peers', +); +$plugin->add_mode( + internal => 'device::ha::status', + spec => 'ha-status', + alias => undef, + help => 'Check the status of a clustered setup', +); +$plugin->add_mode( + internal => 'device::ha::role', + spec => 'ha-role', + alias => undef, + help => 'Check the role in a ha group', +); +$plugin->add_mode( + internal => 'device::svn::status', + spec => 'svn-status', + alias => undef, + help => 'Check the status of the svn subsystem', +); +$plugin->add_mode( + internal => 'device::mngmt::status', + spec => 'mngmt-status', + alias => undef, + help => 'Check the status of the management subsystem', +); +$plugin->add_mode( + internal => 'device::process::status', + spec => 'process-status', + alias => undef, + help => 'Check the status of the running processes' +); +$plugin->add_mode( + internal => 'device::fw::policy::installed', + spec => 'fw-policy', + alias => undef, + help => 'Check the installed firewall policy', +); +$plugin->add_mode( + internal => 'device::fw::policy::connections', + spec => 'fw-connections', + alias => undef, + help => 'Check the number of firewall policy connections', +); +$plugin->add_mode( + internal => 'device::lb::session::usage', + spec => 'session-usage', + alias => undef, + help => 'Check the session limits of a load balancer', +); +$plugin->add_mode( + internal => 'device::security', + spec => 'security-status', + alias => undef, + help => 'Check if there are security-relevant incidents', +); +$plugin->add_mode( + internal => 'device::lb::pool::completeness', + spec => 'pool-completeness', + alias => undef, + help => 'Check the members of a load balancer pool', +); +$plugin->add_mode( + internal => 'device::lb::pool::connections', + spec => 'pool-connections', + alias => undef, + help => 'Check the number of connections of a load balancer pool', +); +$plugin->add_mode( + internal => 'device::lb::pool::complections', + spec => 'pool-complections', + alias => undef, + help => 'Check the members and connections of a load balancer pool', +); +$plugin->add_mode( + internal => 'device::wideip::status', + spec => 'wideip-status', + alias => undef, + help => 'Check the status of F5 Wide IPs', +); +$plugin->add_mode( + internal => 'device::lb::pool::list', + spec => 'list-pools', + alias => undef, + help => 'List load balancer pools', +); +$plugin->add_mode( + internal => 'device::licenses::validate', + spec => 'check-licenses', + alias => undef, + help => 'Check the installed licences/keys', +); +$plugin->add_mode( + internal => 'device::users::count', + spec => 'count-users', + help => 'Count the (connected) users/sessions', +); +$plugin->add_mode( + internal => 'device::config::status', + spec => 'check-config', + alias => undef, + help => 'Check the status of configs (cisco, unsaved config changes)', +); +$plugin->add_mode( + internal => 'device::connections::check', + spec => 'check-connections', + alias => undef, + help => 'Check the quality of connections', +); +$plugin->add_mode( + internal => 'device::connections::count', + spec => 'count-connections', + alias => ['count-connections-client', 'count-connections-server', 'count-sessions'], + help => 'Check the number of connections/sessions (-client, -server is possible)', +); +$plugin->add_mode( + internal => 'device::cisco::fex::watch', + spec => 'watch-fexes', + alias => undef, + help => 'Check if FEXes appear and disappear (use --lookup)', +); +$plugin->add_mode( + internal => 'device::hardware::chassis::health', + spec => 'chassis-hardware-health', + alias => undef, + help => 'Check the status of stacked switches and chassis, count modules and ports', +); +$plugin->add_mode( + internal => 'device::wlan::aps::status', + spec => 'accesspoint-status', + alias => undef, + help => 'Check the status of access points', +); +$plugin->add_mode( + internal => 'device::wlan::aps::count', + spec => 'count-accesspoints', + alias => undef, + help => 'Check if the number of access points is within a certain range', +); +$plugin->add_mode( + internal => 'device::wlan::aps::watch', + spec => 'watch-accesspoints', + alias => undef, + help => 'Check if access points appear and disappear (use --lookup)', +); +$plugin->add_mode( + internal => 'device::wlan::aps::clients', + spec => 'count-accesspoint-clients', + alias => undef, + help => 'Check if the number of access point clients is within a certain range', +); +$plugin->add_mode( + internal => 'device::wlan::aps::list', + spec => 'list-accesspoints', + alias => undef, + help => 'List access points managed by this device', +); +$plugin->add_mode( + internal => 'device::phone::cmstatus', + spec => 'phone-cm-status', + alias => undef, + help => 'Check if the callmanager is up', +); +$plugin->add_mode( + internal => 'device::phone::status', + spec => 'phone-status', + alias => undef, + help => 'Check the number of registered/unregistered/rejected phones', +); +$plugin->add_mode( + internal => 'device::smarthome::device::list', + spec => 'list-smart-home-devices', + alias => undef, + help => 'List Fritz!DECT 200 plugs managed by this device', +); +$plugin->add_mode( + internal => 'device::smarthome::device::status', + spec => 'smart-home-device-status', + alias => undef, + help => 'Check if a Fritz!DECT 200 plug is on (or Comet DECT)', +); +$plugin->add_mode( + internal => 'device::smarthome::device::energy', + spec => 'smart-home-device-energy', + alias => undef, + help => 'Show the current power consumption of a Fritz!DECT 200 plug', +); +$plugin->add_mode( + internal => 'device::smarthome::device::consumption', + spec => 'smart-home-device-consumption', + alias => undef, + help => 'Show the cumulated power consumption of a Fritz!DECT 200 plug', +); +$plugin->add_mode( + internal => 'device::smarthome::device::temperature', + spec => 'smart-home-device-temperature', + alias => undef, + help => 'Show the temperature measured by a Fritz! compatible device', +); +$plugin->add_default_modes(); +$plugin->add_snmp_modes(); +$plugin->add_snmp_args(); +$plugin->add_default_args(); +$plugin->mod_arg("name", + help => "--name + The name of an interface (ifDescr) or pool or ...", +); +$plugin->add_arg( + spec => 'alias=s', + help => "--alias + The alias name of a 64bit-interface (ifAlias)", + required => 0, +); +$plugin->add_arg( + spec => 'ifspeedin=i', + help => "--ifspeedin + Override the ifspeed oid of an interface (only inbound)", + required => 0, +); +$plugin->add_arg( + spec => 'ifspeedout=i', + help => "--ifspeedout + Override the ifspeed oid of an interface (only outbound)", + required => 0, +); +$plugin->add_arg( + spec => 'ifspeed=i', + help => "--ifspeed + Override the ifspeed oid of an interface", + required => 0, +); +$plugin->add_arg( + spec => 'role=s', + help => "--role + The role of this device in a hsrp group (active/standby/listen)", + required => 0, +); + +$plugin->getopts(); +$plugin->classify(); +$plugin->validate_args(); + +if (! $plugin->check_messages()) { + $plugin->init(); + if (! $plugin->check_messages()) { + $plugin->add_ok($plugin->get_summary()) + if $plugin->get_summary(); + $plugin->add_ok($plugin->get_extendedinfo(" ")) + if $plugin->get_extendedinfo(); + } +} elsif ($plugin->opts->snmpwalk && $plugin->opts->offline) { + ; +} else { + ; +} +my ($code, $message) = $plugin->opts->multiline ? + $plugin->check_messages(join => "\n", join_all => ', ') : + $plugin->check_messages(join => ', ', join_all => ', '); +$message .= sprintf "\n%s\n", $plugin->get_info("\n") + if $plugin->opts->verbose >= 1; + +$plugin->nagios_exit($code, $message); diff --git a/monitoring/icinga2/scripts/check_rtmp.sh b/monitoring/icinga2/scripts/check_rtmp.sh new file mode 100755 index 0000000..9fb5de5 --- /dev/null +++ b/monitoring/icinga2/scripts/check_rtmp.sh @@ -0,0 +1,96 @@ +#!/bin/sh +# FILE: "check_rtmp" +# DESCRIPTION:nagios plugin for checking rtmp streams. +# REQUIRES: rtmpdump (http://rtmpdump.mplayerhq.hu/) +# AUTHOR: Toni Comerma +# DATE: jan-2013 +# $Id:$ +# + +PROGNAME=`readlink -f $0` +PROGPATH=`echo $PROGNAME | sed -e 's,[\\/][^\\/][^\\/]*$,,'` +REVISION=`echo '$Revision: .2 $' | sed -e 's/[^0-9.]//g'` + +RTMPDUMP=`which rtmpdump` + +print_usage() { + echo "Usage:" + echo " $PROGNAME -u -t " + echo " $PROGNAME -h " + + +} + +print_help() { + print_revision $PROGNAME $REVISION + echo "" + print_usage + + echo "Comprova l'estat d'un stream RTMP" + echo "" + echo "Opcions:" + echo " -u URL a testejar Exemple: rtmp://server/app/streamName" + echo " -t Temps a monitoritzar" + echo "" + exit $STATE_UNKNOWN +} + + + +STATE_OK=0 +STATE_WARNING=1 +STATE_CRITICAL=2 +STATE_UNKNOWN=3 + +URL="" +TIMEOUT=2 + +# Proces de parametres +while getopts ":u:t:h" Option +do + case $Option in + u ) URL=$OPTARG;; + t ) TIMEOUT=$OPTARG;; + h ) print_help;; + * ) echo "unimplemented option";; + + esac +done + +if [ ! $URL ] ; then + echo " Error - No URI specified to monitor " + echo "" + print_help + echo "" +fi + +# Construir noms de fitxers temporals +NAME=`echo $URL | sed -e s/[^A-Za-z0-9.]/_/g` +ERR=/tmp/check_rtmp_err_$NAME.tmp + +# Testejant +timeout --preserve-status 7 $RTMPDUMP --live -r $URL --stop $TIMEOUT > /dev/null 2> $ERR +status=$? + + +# Retorn de resultats +CONNECTA=`grep "INFO: Connected" $ERR` + +if [ -z "$CONNECTA" ] +then + echo "CRITICAL - No connection to server: $URL" + exit $STATE_CRITICAL +else + ERROR=`grep "INFO: Metadata:" $ERR` + if [ ! -z "$ERROR" ] + then + echo "OK - Stream working: $URL" + exit $STATE_OK + fi + echo "CRITICAL - Stream NOT working: $URL" + exit $STATE_CRITICAL +fi + +echo "UNKNOWN - Alguna condicio no esperada ha permes arribar fins aqui. Revisar check" +exit $STATE_UNKNOWN + diff --git a/monitoring/icinga2/scripts/check_snmp_cisco_poe.pl b/monitoring/icinga2/scripts/check_snmp_cisco_poe.pl new file mode 100755 index 0000000..827d540 --- /dev/null +++ b/monitoring/icinga2/scripts/check_snmp_cisco_poe.pl @@ -0,0 +1,477 @@ +#!/usr/bin/perl +# ============================================================================ +# ============================== INFO ======================================== +# ============================================================================ +# Version : 0.3 +# Date : March 6 2019 +# Author : Michiel Timmers ( michiel.timmers AT gmx.net) +Farid Joubbi +# Licence : GPL - summary below +# +# ============================================================================ +# ============================== SUMMARY ===================================== +# ============================================================================ +# +# Check the PoE availability of a Cisco switch +# version 0.3 By farid@joubbi.se: +# - Added performace data +# - Small modifications of output +# +# version 0.2: +# - fix for Cisco bug CSCtl11469. Data is now collected via a snmpwalk +# - added support for stackble switches +# +# Check the http://exchange.nagios.org website for new versions. +# For comments, questions, problems and patches send me an +# e-mail (michiel.timmmers AT gmx.net). +# +# ============================================================================ +# ============================== LICENCE ===================================== +# ============================================================================ +# 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 +# (at your option) 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 +# +# ============================================================================ +# ============================== HELP ======================================== +# ============================================================================ +# Help : ./check_snmp_cisco_poe.pl --help +# +# ============================================================================ + +use warnings; +use strict; +use Net::SNMP; +use Getopt::Long; +use Scalar::Util qw(looks_like_number); +#use lib "/usr/local/nagios/libexec"; +#use utils qw(%ERRORS $TIMEOUT); + + +# ============================================================================ +# ============================== NAGIOS VARIABLES ============================ +# ============================================================================ + +my $TIMEOUT = 15; # This is the global script timeout, not the SNMP timeout +my %ERRORS = ('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4); +my @Nagios_state = ("UNKNOWN","OK","WARNING","CRITICAL"); # Nagios states coding + + +# ============================================================================ +# ============================== OID VARIABLES =============================== +# ============================================================================ + +# System description +my $cisco_pethMainPseEntry_oid = "1.3.6.1.2.1.105.1.3.1.1"; # pethMainPseEntry +my $cisco_pethMainPsePower_oid = "1.3.6.1.2.1.105.1.3.1.1.2"; # pethMainPsePower +my $cisco_pethMainPseOperStatus_oid = "1.3.6.1.2.1.105.1.3.1.1.3"; # pethMainPseOperStatus +my $cisco_pethMainPseConsumptionPower_oid = "1.3.6.1.2.1.105.1.3.1.1.4"; # pethMainPseConsumptionPower + + +# ============================================================================ +# ============================== GLOBAL VARIABLES ============================ +# ============================================================================ + +my $Version = '0.3'; # Version number of this script +my $o_host = undef; # Hostname +my $o_community = undef; # Community +my $o_port = 161; # Port +my $o_help = undef; # Want some help ? +my $o_verb = undef; # Verbose mode +my $o_version = undef; # Print version +my $o_timeout = undef; # Timeout (Default 5) +my $o_version1 = undef; # Use SNMPv1 +my $o_version2 = undef; # Use SNMPv2c +my $o_domain = undef; # Use IPv6 +my $o_login = undef; # Login for SNMPv3 +my $o_passwd = undef; # Pass for SNMPv3 +my $v3protocols = undef; # V3 protocol list. +my $o_authproto = 'sha'; # Auth protocol +my $o_privproto = 'aes'; # Priv protocol +my $o_privpass = undef; # priv password +my $o_warning = undef; # Warning threshold +my $o_critical = undef; # Critical threshold + + +# ============================================================================ +# ============================== SUBROUTINES (FUNCTIONS) ===================== +# ============================================================================ + +# Subroutine: Print version +sub p_version { + print "check_snmp_cisco_poe version : $Version\n"; +} + +# Subroutine: Print Usage +sub print_usage { + print "Usage: $0 [-v] -H [-6] -C [-2] -w -c | (-l login -x passwd [-X pass -L ,]) [-p ] [-t ] [-V]\n"; +} + +# Subroutine: Check number +sub isnnum { # Return true if arg is not a number + my $num = shift; + if ( $num =~ /^(\d+\.?\d*)|(^\.\d+)$/ ) { return 0 ;} + return 1; +} + +# Subroutine: Set final status +sub set_status { # Return worst status with this order : OK, unknown, warning, critical + my $new_status = shift; + my $cur_status = shift; + if ($new_status == 1 && $cur_status != 2) {$cur_status = $new_status;} + if ($new_status == 2) {$cur_status = $new_status;} + if ($new_status == 3 && $cur_status == 0) {$cur_status = $new_status;} + return $cur_status; +} + +# Subroutine: Check if SNMP table could be retrieved, otherwise give error +sub check_snmp_result { + my $snmp_table = shift; + my $snmp_error_mesg = shift; + + # Check if table is defined and does not contain specified error message. + # Had to do string compare it will not work with a status code + if (!defined($snmp_table) && $snmp_error_mesg !~ /table is empty or does not exist/) { + printf("ERROR: ". $snmp_error_mesg . " : UNKNOWN\n"); + exit $ERRORS{"UNKNOWN"}; + } +} + +# Subroutine: Print complete help +sub help { + print "\nSNMP Cisco SNMP PoE check plugin for Nagios\nVersion: ",$Version,"\n\n"; + print_usage(); + print <, + : Authentication protocol (md5|sha : default sha) + : Priv protocole (des|aes : default aes) +-P, --port=PORT + SNMP port (Default 161) +-t, --timeout=INTEGER + Timeout for SNMP in seconds (Default: 5) +-V, --version + Prints version number + +Notes: +- Check the http://exchange.nagios.org website for new versions. +- For questions, problems and patches send me an e-mail (michiel.timmmers AT gmx.net). + +EOT +} + +# Subroutine: Verbose output +sub verb { + my $t=shift; + print $t,"\n" if defined($o_verb); +} + +# Subroutine: Verbose output +sub check_options { + Getopt::Long::Configure ("bundling"); + GetOptions( + 'v' => \$o_verb, 'verbose' => \$o_verb, + 'h' => \$o_help, 'help' => \$o_help, + 'H:s' => \$o_host, 'hostname:s' => \$o_host, + 'p:i' => \$o_port, 'port:i' => \$o_port, + 'C:s' => \$o_community, 'community:s' => \$o_community, + 'l:s' => \$o_login, 'login:s' => \$o_login, + 'x:s' => \$o_passwd, 'passwd:s' => \$o_passwd, + 'X:s' => \$o_privpass, 'privpass:s' => \$o_privpass, + 'L:s' => \$v3protocols, 'protocols:s' => \$v3protocols, + 't:i' => \$o_timeout, 'timeout:i' => \$o_timeout, + 'V' => \$o_version, 'version' => \$o_version, + '6' => \$o_domain, 'use-ipv6' => \$o_domain, + '1' => \$o_version1, 'v1' => \$o_version1, + '2' => \$o_version2, 'v2c' => \$o_version2, + 'w:i' => \$o_warning, 'warning:i' => \$o_warning, + 'c:i' => \$o_critical, 'critical:i' => \$o_critical + ); + + + # Basic checks + if (defined($o_timeout) && (isnnum($o_timeout) || ($o_timeout < 2) || ($o_timeout > 60))) { + print "Timeout must be >1 and <60 !\n"; + print_usage(); + exit $ERRORS{"UNKNOWN"}; + } + if (!defined($o_timeout)) { + $o_timeout=5; + } + if (defined ($o_help) ) { + help(); + exit $ERRORS{"UNKNOWN"}; + } + + if (defined($o_version)) { + p_version(); + exit $ERRORS{"UNKNOWN"}; + } + + # check host and filter + if ( ! defined($o_host) ) { + print_usage(); + exit $ERRORS{"UNKNOWN"}; + } + + # Check IPv6 + if (defined ($o_domain)) { + $o_domain="udp/ipv6"; + } else { + $o_domain="udp/ipv4"; + } + + # Check SNMP information + if ( !defined($o_community) && (!defined($o_login) || !defined($o_passwd)) ){ + print "Put SNMP login info!\n"; + print_usage(); + exit $ERRORS{"UNKNOWN"}; + } + if ((defined($o_login) || defined($o_passwd)) && (defined($o_community) || defined($o_version2)) ){ + print "Can't mix SNMP v1,v2c,v3 protocols!\n"; + print_usage(); + exit $ERRORS{"UNKNOWN"}; + } + + # Check SNMPv3 information + if (defined ($v3protocols)) { + if (!defined($o_login)) { + print "Put SNMP V3 login info with protocols!\n"; + print_usage(); + exit $ERRORS{"UNKNOWN"}; + } + my @v3proto=split(/,/,$v3protocols); + if ((defined ($v3proto[0])) && ($v3proto[0] ne "")) { + $o_authproto=$v3proto[0]; + } + if (defined ($v3proto[1])) { + $o_privproto=$v3proto[1]; + } + if ((defined ($v3proto[1])) && (!defined($o_privpass))) { + print "Put SNMP v3 priv login info with priv protocols!\n"; + print_usage(); + exit $ERRORS{"UNKNOWN"}; + } + } + + if ( ! defined($o_warning) ) { + print_usage(); + exit $ERRORS{"UNKNOWN"}; + } + + if ( ! defined($o_critical) ) { + print_usage(); + exit $ERRORS{"UNKNOWN"}; + } +} + + +# ============================================================================ +# ============================== MAIN ======================================== +# ============================================================================ + +check_options(); + +# Check gobal timeout if SNMP screws up +if (defined($TIMEOUT)) { + verb("Alarm at ".$TIMEOUT." + ".$o_timeout); + alarm($TIMEOUT+$o_timeout); +} else { + verb("no global timeout defined : ".$o_timeout." + 15"); + alarm ($o_timeout+15); +} + +# Report when the script gets "stuck" in a loop or takes to long +$SIG{'ALRM'} = sub { + print "UNKNOWN: Script timed out\n"; + exit $ERRORS{"UNKNOWN"}; +}; + +# Connect to host +my ($session,$error); +if (defined($o_login) && defined($o_passwd)) { + # SNMPv3 login + verb("SNMPv3 login"); + if (!defined ($o_privpass)) { + # SNMPv3 login (Without encryption) + verb("SNMPv3 AuthNoPriv login : $o_login, $o_authproto"); + ($session, $error) = Net::SNMP->session( + -domain => $o_domain, + -hostname => $o_host, + -version => 3, + -username => $o_login, + -authpassword => $o_passwd, + -authprotocol => $o_authproto, + -timeout => $o_timeout + ); + } else { + # SNMPv3 login (With encryption) + verb("SNMPv3 AuthPriv login : $o_login, $o_authproto, $o_privproto"); + ($session, $error) = Net::SNMP->session( + -domain => $o_domain, + -hostname => $o_host, + -version => 3, + -username => $o_login, + -authpassword => $o_passwd, + -authprotocol => $o_authproto, + -privpassword => $o_privpass, + -privprotocol => $o_privproto, + -timeout => $o_timeout + ); + } +} else { + if ((defined ($o_version2)) || (!defined ($o_version1))) { + # SNMPv2 login + verb("SNMP v2c login"); + ($session, $error) = Net::SNMP->session( + -domain => $o_domain, + -hostname => $o_host, + -version => 2, + -community => $o_community, + -port => $o_port, + -timeout => $o_timeout + ); + } else { + # SNMPv1 login + verb("SNMP v1 login"); + ($session, $error) = Net::SNMP->session( + -domain => $o_domain, + -hostname => $o_host, + -version => 1, + -community => $o_community, + -port => $o_port, + -timeout => $o_timeout + ); + } +} + +# Check if there are any problems with the session +if (!defined($session)) { + printf("ERROR opening session: %s.\n", $error); + exit $ERRORS{"UNKNOWN"}; +} + +my $exit_val=undef; + + +# ============================================================================ +# ============================== Cisco - PoE ================================= +# ============================================================================ + +# Define variables +my $output = ""; +my $output_pd = ""; +my $final_status = 0; +my $result_t; +my $index; +my @temp_oid; +my ($pethMainPsePower,$pethMainPseOperStatus,$pethMainPseConsumptionPower,$module)=(undef,undef,undef,undef); + +# Get SNMP table(s) and check the result +my $cisco_pethMainPseEntry = $session->get_table(Baseoid => $cisco_pethMainPseEntry_oid); +&check_snmp_result($cisco_pethMainPseEntry,$session->error); + +if (defined($cisco_pethMainPseEntry)) { + foreach my $key ( keys %$cisco_pethMainPseEntry) { + if ($key =~ /$cisco_pethMainPseOperStatus_oid/) { + $key =~ s/$cisco_pethMainPseOperStatus_oid//; + + $module = substr $key, 1; + + # Set the Pse variables + $pethMainPsePower = $$cisco_pethMainPseEntry{$cisco_pethMainPsePower_oid.$key}; + $pethMainPseOperStatus = $$cisco_pethMainPseEntry{$cisco_pethMainPseOperStatus_oid.$key}; + $pethMainPseConsumptionPower = $$cisco_pethMainPseEntry{$cisco_pethMainPseConsumptionPower_oid.$key}; + + if (defined($pethMainPsePower) && defined($pethMainPseOperStatus) && defined($pethMainPseConsumptionPower)){ + + if (!looks_like_number($pethMainPsePower) && !looks_like_number($pethMainPseOperStatus) && !looks_like_number($pethMainPseConsumptionPower)) { + $output = "Module:".$module." Device does not have PoE"; + }else{ + if ($pethMainPseOperStatus != 1){ + $final_status = 2; + $output = "Module:".$module." Power Sourcing Equipment (PSE) is not on"; + }else{ + if($pethMainPsePower - $pethMainPseConsumptionPower < $o_warning){ + $final_status = &set_status(1,$final_status); + } + + if($pethMainPsePower - $pethMainPseConsumptionPower < $o_critical){ + $final_status = &set_status(2,$final_status); + } + + if ($output eq ""){ + $output = "Module:".$module." Available:".$pethMainPsePower." W, Used:".$pethMainPseConsumptionPower." W, Remaining:".($pethMainPsePower - $pethMainPseConsumptionPower)." W"; + $output_pd = " | M".$module."_Used=".$pethMainPseConsumptionPower.";".($pethMainPsePower - $o_warning).";".($pethMainPsePower - $o_critical).";0;".$pethMainPsePower; + }else{ + $output.= " - Module:".$module." Available:".$pethMainPsePower." W, Used:".$pethMainPseConsumptionPower." W, Remaining:".($pethMainPsePower - $pethMainPseConsumptionPower)." W"; + $output_pd.= " M".$module."_Used=".$pethMainPseConsumptionPower.";".($pethMainPsePower - $o_warning).";".($pethMainPsePower - $o_critical).";0;".$pethMainPsePower; + } + } + } + } + } + } + +}else{ + $output = "Device does not have PoE"; +} + +if ($final_status == 3) { + print $output," : UNKNOWN\n"; + exit $ERRORS{"UNKNOWN"}; +} + +if ($final_status == 2) { + print $output," : CRITICAL",$output_pd,"\n"; + exit $ERRORS{"CRITICAL"}; +} + +if ($final_status == 1) { + print $output," : WARNING",$output_pd,"\n"; + exit $ERRORS{"WARNING"}; +} + +print $output," : OK",$output_pd,"\n"; +exit $ERRORS{"OK"}; + + +# ============================================================================ +# ============================== NO CHECK DEFINED ============================ +# ============================================================================ + +print "Unknown check type : UNKNOWN\n"; +exit $ERRORS{"UNKNOWN"}; + diff --git a/monitoring/icinga2/scripts/mail-host-notification.sh b/monitoring/icinga2/scripts/mail-host-notification.sh new file mode 100755 index 0000000..93f942e --- /dev/null +++ b/monitoring/icinga2/scripts/mail-host-notification.sh @@ -0,0 +1,171 @@ +#!/bin/sh +# Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ +# Except of function urlencode which is Copyright (C) by Brian White (brian@aljex.com) used under MIT license + +PROG="`basename $0`" +ICINGA2HOST="`hostname`" +MAILBIN="mail" + +if [ -z "`which $MAILBIN`" ] ; then + echo "$MAILBIN not found in \$PATH. Consider installing it." + exit 1 +fi + +## Function helpers +Usage() { +cat << EOF + +Required parameters: + -d LONGDATETIME (\$icinga.long_date_time\$) + -l HOSTNAME (\$host.name\$) + -n HOSTDISPLAYNAME (\$host.display_name\$) + -o HOSTOUTPUT (\$host.output\$) + -r USEREMAIL (\$user.email\$) + -s HOSTSTATE (\$host.state\$) + -t NOTIFICATIONTYPE (\$notification.type\$) + +Optional parameters: + -4 HOSTADDRESS (\$address\$) + -6 HOSTADDRESS6 (\$address6\$) + -b NOTIFICATIONAUTHORNAME (\$notification.author\$) + -c NOTIFICATIONCOMMENT (\$notification.comment\$) + -i ICINGAWEB2URL (\$notification_icingaweb2url\$, Default: unset) + -f MAILFROM (\$notification_mailfrom\$, requires GNU mailutils (Debian/Ubuntu) or mailx (RHEL/SUSE)) + -v (\$notification_sendtosyslog\$, Default: false) + +EOF +} + +Help() { + Usage; + exit 0; +} + +Error() { + if [ "$1" ]; then + echo $1 + fi + Usage; + exit 1; +} + +urlencode() { + local LANG=C i=0 c e s="$1" + + while [ $i -lt ${#1} ]; do + [ "$i" -eq 0 ] || s="${s#?}" + c=${s%"${s#?}"} + [ -z "${c#[[:alnum:].~_-]}" ] || c=$(printf '%%%02X' "'$c") + e="${e}${c}" + i=$((i + 1)) + done + echo "$e" +} + +## Main +while getopts 4:6::b:c:d:f:hi:l:n:o:r:s:t:v: opt +do + case "$opt" in + 4) HOSTADDRESS=$OPTARG ;; + 6) HOSTADDRESS6=$OPTARG ;; + b) NOTIFICATIONAUTHORNAME=$OPTARG ;; + c) NOTIFICATIONCOMMENT=$OPTARG ;; + d) LONGDATETIME=$OPTARG ;; # required + f) MAILFROM=$OPTARG ;; + h) Help ;; + i) ICINGAWEB2URL=$OPTARG ;; + l) HOSTNAME=$OPTARG ;; # required + n) HOSTDISPLAYNAME=$OPTARG ;; # required + o) HOSTOUTPUT=$OPTARG ;; # required + r) USEREMAIL=$OPTARG ;; # required + s) HOSTSTATE=$OPTARG ;; # required + t) NOTIFICATIONTYPE=$OPTARG ;; # required + v) VERBOSE=$OPTARG ;; + \?) echo "ERROR: Invalid option -$OPTARG" >&2 + Error ;; + :) echo "Missing option argument for -$OPTARG" >&2 + Error ;; + *) echo "Unimplemented option: -$OPTARG" >&2 + Error ;; + esac +done + +shift $((OPTIND - 1)) + +## Keep formatting in sync with mail-service-notification.sh +for P in LONGDATETIME HOSTNAME HOSTDISPLAYNAME HOSTOUTPUT HOSTSTATE USEREMAIL NOTIFICATIONTYPE ; do + eval "PAR=\$${P}" + + if [ ! "$PAR" ] ; then + Error "Required parameter '$P' is missing." + fi +done + +## Build the message's subject +SUBJECT="[$NOTIFICATIONTYPE] Host $HOSTDISPLAYNAME is $HOSTSTATE!" + +## Build the notification message +NOTIFICATION_MESSAGE=`cat << EOF +***** Host Monitoring on $ICINGA2HOST ***** + +$HOSTDISPLAYNAME is $HOSTSTATE! + +Info: $HOSTOUTPUT + +When: $LONGDATETIME +Host: $HOSTNAME +EOF +` + +## Check whether IPv4 was specified. +if [ -n "$HOSTADDRESS" ] ; then + NOTIFICATION_MESSAGE="$NOTIFICATION_MESSAGE +IPv4: $HOSTADDRESS" +fi + +## Check whether IPv6 was specified. +if [ -n "$HOSTADDRESS6" ] ; then + NOTIFICATION_MESSAGE="$NOTIFICATION_MESSAGE +IPv6: $HOSTADDRESS6" +fi + +## Check whether author and comment was specified. +if [ -n "$NOTIFICATIONCOMMENT" ] ; then + NOTIFICATION_MESSAGE="$NOTIFICATION_MESSAGE + +Comment by $NOTIFICATIONAUTHORNAME: + $NOTIFICATIONCOMMENT" +fi + +## Check whether Icinga Web 2 URL was specified. +if [ -n "$ICINGAWEB2URL" ] ; then + NOTIFICATION_MESSAGE="$NOTIFICATION_MESSAGE + +$ICINGAWEB2URL/monitoring/host/show?host=$(urlencode "$HOSTNAME")" +fi + +## Check whether verbose mode was enabled and log to syslog. +if [ "$VERBOSE" == "true" ] ; then + logger "$PROG sends $SUBJECT => $USEREMAIL" +fi + +## Send the mail using the $MAILBIN command. +## If an explicit sender was specified, try to set it. +if [ -n "$MAILFROM" ] ; then + + ## Modify this for your own needs! + + ## Debian/Ubuntu use mailutils which requires `-a` to append the header + if [ -f /etc/debian_version ]; then + /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | tr -d '\015' \ + | $MAILBIN -a "From: $MAILFROM" -s "$SUBJECT" $USEREMAIL + ## Other distributions (RHEL/SUSE/etc.) prefer mailx which sets a sender address with `-r` + else + /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | tr -d '\015' \ + | $MAILBIN -r "$MAILFROM" -s "$SUBJECT" $USEREMAIL + fi + +else + /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | tr -d '\015' \ + | $MAILBIN -s "$SUBJECT" $USEREMAIL +fi diff --git a/monitoring/icinga2/scripts/mail-service-notification.sh b/monitoring/icinga2/scripts/mail-service-notification.sh new file mode 100755 index 0000000..8ccb8d4 --- /dev/null +++ b/monitoring/icinga2/scripts/mail-service-notification.sh @@ -0,0 +1,176 @@ +#!/bin/sh +# Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ +# Except of function urlencode which is Copyright (C) by Brian White (brian@aljex.com) used under MIT license + +PROG="`basename $0`" +ICINGA2HOST="`hostname`" +MAILBIN="mail" + +if [ -z "`which $MAILBIN`" ] ; then + echo "$MAILBIN not found in \$PATH. Consider installing it." + exit 1 +fi + +## Function helpers +Usage() { +cat << EOF + +Required parameters: + -d LONGDATETIME (\$icinga.long_date_time\$) + -e SERVICENAME (\$service.name\$) + -l HOSTNAME (\$host.name\$) + -n HOSTDISPLAYNAME (\$host.display_name\$) + -o SERVICEOUTPUT (\$service.output\$) + -r USEREMAIL (\$user.email\$) + -s SERVICESTATE (\$service.state\$) + -t NOTIFICATIONTYPE (\$notification.type\$) + -u SERVICEDISPLAYNAME (\$service.display_name\$) + +Optional parameters: + -4 HOSTADDRESS (\$address\$) + -6 HOSTADDRESS6 (\$address6\$) + -b NOTIFICATIONAUTHORNAME (\$notification.author\$) + -c NOTIFICATIONCOMMENT (\$notification.comment\$) + -i ICINGAWEB2URL (\$notification_icingaweb2url\$, Default: unset) + -f MAILFROM (\$notification_mailfrom\$, requires GNU mailutils (Debian/Ubuntu) or mailx (RHEL/SUSE)) + -v (\$notification_sendtosyslog\$, Default: false) + +EOF +} + +Help() { + Usage; + exit 0; +} + +Error() { + if [ "$1" ]; then + echo $1 + fi + Usage; + exit 1; +} + +urlencode() { + local LANG=C i=0 c e s="$1" + + while [ $i -lt ${#1} ]; do + [ "$i" -eq 0 ] || s="${s#?}" + c=${s%"${s#?}"} + [ -z "${c#[[:alnum:].~_-]}" ] || c=$(printf '%%%02X' "'$c") + e="${e}${c}" + i=$((i + 1)) + done + echo "$e" +} + +## Main +while getopts 4:6:b:c:d:e:f:hi:l:n:o:r:s:t:u:v: opt +do + case "$opt" in + 4) HOSTADDRESS=$OPTARG ;; + 6) HOSTADDRESS6=$OPTARG ;; + b) NOTIFICATIONAUTHORNAME=$OPTARG ;; + c) NOTIFICATIONCOMMENT=$OPTARG ;; + d) LONGDATETIME=$OPTARG ;; # required + e) SERVICENAME=$OPTARG ;; # required + f) MAILFROM=$OPTARG ;; + h) Usage ;; + i) ICINGAWEB2URL=$OPTARG ;; + l) HOSTNAME=$OPTARG ;; # required + n) HOSTDISPLAYNAME=$OPTARG ;; # required + o) SERVICEOUTPUT=$OPTARG ;; # required + r) USEREMAIL=$OPTARG ;; # required + s) SERVICESTATE=$OPTARG ;; # required + t) NOTIFICATIONTYPE=$OPTARG ;; # required + u) SERVICEDISPLAYNAME=$OPTARG ;; # required + v) VERBOSE=$OPTARG ;; + \?) echo "ERROR: Invalid option -$OPTARG" >&2 + Usage ;; + :) echo "Missing option argument for -$OPTARG" >&2 + Usage ;; + *) echo "Unimplemented option: -$OPTARG" >&2 + Usage ;; + esac +done + +shift $((OPTIND - 1)) + +## Keep formatting in sync with mail-host-notification.sh +for P in LONGDATETIME HOSTNAME HOSTDISPLAYNAME SERVICENAME SERVICEDISPLAYNAME SERVICEOUTPUT SERVICESTATE USEREMAIL NOTIFICATIONTYPE ; do + eval "PAR=\$${P}" + + if [ ! "$PAR" ] ; then + Error "Required parameter '$P' is missing." + fi +done + +## Build the message's subject +SUBJECT="[$NOTIFICATIONTYPE] $SERVICEDISPLAYNAME on $HOSTDISPLAYNAME is $SERVICESTATE!" + +## Build the notification message +NOTIFICATION_MESSAGE=`cat << EOF +***** Service Monitoring on $ICINGA2HOST ***** + +$SERVICEDISPLAYNAME on $HOSTDISPLAYNAME is $SERVICESTATE! + +Info: $SERVICEOUTPUT + +When: $LONGDATETIME +Service: $SERVICENAME +Host: $HOSTNAME +EOF +` + +## Check whether IPv4 was specified. +if [ -n "$HOSTADDRESS" ] ; then + NOTIFICATION_MESSAGE="$NOTIFICATION_MESSAGE +IPv4: $HOSTADDRESS" +fi + +## Check whether IPv6 was specified. +if [ -n "$HOSTADDRESS6" ] ; then + NOTIFICATION_MESSAGE="$NOTIFICATION_MESSAGE +IPv6: $HOSTADDRESS6" +fi + +## Check whether author and comment was specified. +if [ -n "$NOTIFICATIONCOMMENT" ] ; then + NOTIFICATION_MESSAGE="$NOTIFICATION_MESSAGE + +Comment by $NOTIFICATIONAUTHORNAME: + $NOTIFICATIONCOMMENT" +fi + +## Check whether Icinga Web 2 URL was specified. +if [ -n "$ICINGAWEB2URL" ] ; then + NOTIFICATION_MESSAGE="$NOTIFICATION_MESSAGE + +$ICINGAWEB2URL/monitoring/service/show?host=$(urlencode "$HOSTNAME")&service=$(urlencode "$SERVICENAME")" +fi + +## Check whether verbose mode was enabled and log to syslog. +if [ "$VERBOSE" == "true" ] ; then + logger "$PROG sends $SUBJECT => $USEREMAIL" +fi + +## Send the mail using the $MAILBIN command. +## If an explicit sender was specified, try to set it. +if [ -n "$MAILFROM" ] ; then + + ## Modify this for your own needs! + + ## Debian/Ubuntu use mailutils which requires `-a` to append the header + if [ -f /etc/debian_version ]; then + /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | tr -d '\015' \ + | $MAILBIN -a "From: $MAILFROM" -s "$SUBJECT" $USEREMAIL + ## Other distributions (RHEL/SUSE/etc.) prefer mailx which sets a sender address with `-r` + else + /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | tr -d '\015' \ + | $MAILBIN -r "$MAILFROM" -s "$SUBJECT" $USEREMAIL + fi + +else + /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | tr -d '\015' \ + | $MAILBIN -s "$SUBJECT" $USEREMAIL +fi diff --git a/monitoring/icinga2/scripts/openwrt_check_interface_load.sh b/monitoring/icinga2/scripts/openwrt_check_interface_load.sh new file mode 100755 index 0000000..575a1de --- /dev/null +++ b/monitoring/icinga2/scripts/openwrt_check_interface_load.sh @@ -0,0 +1,157 @@ +#!/bin/ash +# set -x +START=`date +%s` +#INTERFACES=`ls /sys/class/net/` + + +while getopts "w:c:h" OPT; do + case $OPT in + "w") warn=$OPTARG;; + "c") crit=$OPTARG;; + "h") help;; + esac +done + + +WARNING=$(echo "$warn * 1000000" | bc) +CRITICAL=$(echo "$crit * 1000000" | bc) + +#which iftop > /dev/null 2>&1 +#if [ $? != 0 ]; then +# echo "Iftop not installed" +# exit 1 +#fi + +IFTOP="/usr/bin/iftop" +PERFDATA="" +overloaded="" +ex_st=0 +int=0 +int_ol=0 +for i in eth0; +do + #IF_UP=`cat /sys/class/net/$i/operstate` + if [ -e "/sys/class/net/$i/operstate" ]; then + IF_UP=`cat /sys/class/net/$i/operstate 2>&1` + else + continue + fi + if [ $IF_UP == "up" ] || [ $IF_UP == "unknown" ]; then + INTERFACE=$i + TMP_FILE="/tmp/int_${INTERFACE}_cache" + + $IFTOP -i $INTERFACE -n -t -s 2 > $TMP_FILE 2>&1 + if [ $? != 0 ]; then + rm -f $TMP_FILE + continue + fi + + ##### TOTAL ######## + TOTAL=`cat $TMP_FILE | grep -i 'Total send and receive rate'| awk -F ":" '{print $2}'| awk '{print $1}'` + #################### + ##### SEND RATE #### + SEND=`cat $TMP_FILE | grep -i 'Total send rate'| awk -F ":" '{print $2}'| awk '{print $1}'` + ################### + #### REC RATE ##### + REC=`cat $TMP_FILE | grep -i 'Total receive rate'| awk -F ":" '{print $2}'| awk '{print $1}'` + ################## + rm -f $TMP_FILE 2>&1 + + + + metric=`echo "$TOTAL" | grep -Eo '[[:alpha:]]+'` + TOTAL=${TOTAL/${metric}} + TOTAL=`echo "$TOTAL" | sed 's/,/./'` + + if [ $metric == "Mb" ]; then + TOTAL=$(echo "$TOTAL * 1000000" | bc) + elif [ $metric == "Kb" ]; then + TOTAL=$(echo "$TOTAL * 1000" | bc) + elif [ $metric == "b" ]; then + TOTAL=$TOTAL + else + TOTAL=$TOTAL + fi + TOTAL=${TOTAL%.*} + + metric=`echo "$SEND" | grep -Eo '[[:alpha:]]+'` + SEND=${SEND/${metric}} + SEND=`echo "$SEND" | sed 's/,/./'` + + if [ $metric == "Mb" ]; then + SEND=$(echo "$SEND * 1000000" | bc) + elif [ $metric == "Kb" ]; then + SEND=$(echo "$SEND * 1000" | bc) + elif [ $metric == "b" ]; then + SEND=$SEND + else + SEND=$SEND + fi + SEND=${SEND%.*} + + metric=`echo "$REC" | grep -Eo '[[:alpha:]]+'` + REC=${REC/${metric}} + REC=`echo "$REC" | sed 's/,/./'` + + if [ $metric == "Mb" ]; then + REC=$(echo "$REC * 1000000" | bc) + elif [ $metric == "Kb" ]; then + REC=$(echo "$REC * 1000" | bc) + elif [ $metric == "b" ]; then + REC=$REC + else + REC=$REC + fi + REC=${REC%.*} + + if [ -z $TOTAL ] ; then + TOTAL=0 + fi + if [ $TOTAL -ge $CRITICAL ]; then + overloaded="$overloaded $INTERFACE" + int_ol=$(echo "$int_ol + 1" | bc) + ex_st=2 + elif [ $TOTAL -lt $CRITICAL ] && [ $TOTAL -ge $WARNING ]; then + overloaded="$overloaded $INTERFACE" + int_ol=$(echo "$int_ol + 1" | bc) + if [ $ex_st -eq 0 ]; then + ex_st=1 + fi + elif [ $TOTAL -le $WARNING ]; then + if [ $ex_st -eq 0 ]; then + ex_st=0 + fi + else + echo 0 > /dev/null + + fi + + int=$(echo "$int + 1" | bc) + PERFDATA="$PERFDATA Total_$INTERFACE=${TOTAL};${WARNING};${CRITICAL};0;${CRITICAL} Send_$INTERFACE=${SEND}; Receive_$INTERFACE=${REC};" + + elif [ $IF_UP == "down" ]; then + echo 0 > /dev/null + else + echo 0 > /dev/null + fi +done + +END=`date +%s` +EXEC_TIME=$(($END-$START)) +PERFDATA="$PERFDATA ExecTime=$EXEC_TIME;" + +if [ $ex_st -eq 0 ]; then + echo "OK: $int interfaces under expected load | $PERFDATA" + exit $ex_st + +elif [ $ex_st -eq 1 ]; then + echo "Warning: $int_ol overloaded interfaces ($overloaded); $int interfaces OK | $PERFDATA" + exit $ex_st +elif [ $ex_st -eq 2 ]; then + echo "Critical: $int_ol overloaded interfaces ($overloaded); $int interfaces OK | $PERFDATA" + exit $ex_st +else + echo "Unknown: $int_ol overloaded interfaces ($overloaded). $int interfaces OK | $PERFDATA" + exit 3 +fi + diff --git a/monitoring/icinga2/scripts/slack-service-notification.sh b/monitoring/icinga2/scripts/slack-service-notification.sh new file mode 100755 index 0000000..3cab529 --- /dev/null +++ b/monitoring/icinga2/scripts/slack-service-notification.sh @@ -0,0 +1,107 @@ +#!/bin/bash + +ICINGA_HOSTNAME="vin.openfest.org/icingaweb2" +SLACK_WEBHOOK_URL="https://hooks.slack.com/services/some/other/tocken" +SLACK_CHANNEL="#noc" +SLACK_BOTNAME="icinga2" + + +if [ "$NOTIFICATIONTYPE" = "ACKNOWLEDGEMENT" ] || [ "$NOTIFICATIONTYPE" = "DOWNTIMESTART" ] || [ "$NOTIFICATIONTYPE" = "DOWNTIMEEND" ] +then + COLOR="#FFB6C1" +read -d '' PAYLOAD << EOF +{ + "channel": "${SLACK_CHANNEL}", + "username": "${SLACK_BOTNAME}", + "attachments": [ + { + "fallback": "${NOTIFICATIONTYPE}: ${SERVICESTATE}: ${HOSTDISPLAYNAME} - ${SERVICEDISPLAYNAME}", + "color": "${COLOR}", + "fields": [ + { + "title": "${NOTIFICATIONTYPE}", + "value": "${NOTIFICATIONCOMMENT} - ${NOTIFICATIONAUTHORNAME}" + }, + { + "title": "Service output", + "value": "${SERVICEOUTPUT}", + "short": false + }, + { + "title": "Host", + "value": "<${ICINGA_HOSTNAME}/monitoring/host/services?host=${HOSTNAME}|${HOSTDISPLAYNAME}>", + "short": true + }, + { + "title": "Service", + "value": "<${ICINGA_HOSTNAME}/monitoring/service/show?host=${HOSTNAME}&service=${SERVICEDESC}|${SERVICEDISPLAYNAME}>", + "short": true + }, + { + "title": "State", + "value": "${SERVICESTATE}", + "short": true + } + ] + } + ] +} +EOF +else + +#Set the message icon based on ICINGA service state +if [ "$SERVICESTATE" = "CRITICAL" ] +then + COLOR="danger" +elif [ "$SERVICESTATE" = "WARNING" ] +then + COLOR="warning" +elif [ "$SERVICESTATE" = "OK" ] +then + COLOR="good" +elif [ "$SERVICESTATE" = "UNKNOWN" ] +then + COLOR="#800080" +else + COLOR="" +fi + +#Send message to Slack +read -d '' PAYLOAD << EOF +{ + "channel": "${SLACK_CHANNEL}", + "username": "${SLACK_BOTNAME}", + "attachments": [ + { + "fallback": "${SERVICESTATE}: ${HOSTDISPLAYNAME} - ${SERVICEDISPLAYNAME}", + "color": "${COLOR}", + "fields": [ + { + "title": "Service output", + "value": "${SERVICEOUTPUT}", + "short": false + }, + { + "title": "Host", + "value": "<${ICINGA_HOSTNAME}/monitoring/host/services?host=${HOSTNAME}|${HOSTDISPLAYNAME}>", + "short": true + }, + { + "title": "Service", + "value": "<${ICINGA_HOSTNAME}/monitoring/service/show?host=${HOSTNAME}&service=${SERVICEDESC}|${SERVICEDISPLAYNAME}>", + "short": true + }, + { + "title": "State", + "value": "${SERVICESTATE}", + "short": true + } + ] + } + ] +} +EOF + +fi + +curl --connect-timeout 30 --max-time 60 -s -S -X POST -H 'Content-type: application/json' --data "${PAYLOAD}" "${SLACK_WEBHOOK_URL}" diff --git a/monitoring/icinga2/zones.conf b/monitoring/icinga2/zones.conf new file mode 100644 index 0000000..70ac766 --- /dev/null +++ b/monitoring/icinga2/zones.conf @@ -0,0 +1,63 @@ +/* + * Endpoint and Zone configuration for a cluster setup + * This local example requires `NodeName` defined in + * constants.conf. + */ + +object Endpoint NodeName { + host = NodeName +} + +object Zone ZoneName { + endpoints = [ NodeName ] +} + +/* + * Defines a global zone for distributed setups with masters, + * satellites and clients. + * This is required to sync configuration commands, + * templates, apply rules, etc. to satellite and clients. + * All nodes require the same configuration and must + * have `accept_config` enabled in the `api` feature. + */ + +object Zone "global-templates" { + global = true +} + +/* + * Defines a global zone for the Icinga Director. + * This is required to sync configuration commands, + * templates, apply rules, etc. to satellite and clients. + * All nodes require the same configuration and must + * have `accept_config` enabled in the `api` feature. + */ + +object Zone "director-global" { + global = true +} + +/* + * Read the documentation on how to configure + * a cluster setup with multiple zones. + */ + +/* +object Endpoint "master.example.org" { + host = "master.example.org" +} + +object Endpoint "satellite.example.org" { + host = "satellite.example.org" +} + +object Zone "master" { + endpoints = [ "master.example.org" ] +} + +object Zone "satellite" { + parent = "master" + endpoints = [ "satellite.example.org" ] +} +*/ + diff --git a/monitoring/icinga2/zones.d/README b/monitoring/icinga2/zones.d/README new file mode 100644 index 0000000..e378eae --- /dev/null +++ b/monitoring/icinga2/zones.d/README @@ -0,0 +1,2 @@ +Please check the documentation for more details: +https://icinga.com/docs/icinga2/latest/doc/06-distributed-monitoring/ diff --git a/monitoring/icingaweb2/authentication.ini b/monitoring/icingaweb2/authentication.ini new file mode 100644 index 0000000..6852ece --- /dev/null +++ b/monitoring/icingaweb2/authentication.ini @@ -0,0 +1,3 @@ +[icingaweb2] +backend = "db" +resource = "icingaweb_db" diff --git a/monitoring/icingaweb2/config.ini b/monitoring/icingaweb2/config.ini new file mode 100644 index 0000000..41ba83c --- /dev/null +++ b/monitoring/icingaweb2/config.ini @@ -0,0 +1,10 @@ +[global] +show_stacktraces = "1" +show_application_state_messages = "1" +config_backend = "db" +config_resource = "icingaweb_db" + +[logging] +log = "file" +level = "WARNING" +file = "/var/log/icingaweb2/icingaweb2.log" diff --git a/monitoring/icingaweb2/groups.ini b/monitoring/icingaweb2/groups.ini new file mode 100644 index 0000000..6852ece --- /dev/null +++ b/monitoring/icingaweb2/groups.ini @@ -0,0 +1,3 @@ +[icingaweb2] +backend = "db" +resource = "icingaweb_db" diff --git a/monitoring/icingaweb2/modules/graphite/config.ini b/monitoring/icingaweb2/modules/graphite/config.ini new file mode 100644 index 0000000..f4ffe93 --- /dev/null +++ b/monitoring/icingaweb2/modules/graphite/config.ini @@ -0,0 +1,4 @@ +[graphite] +metric_prefix = icinga +url = https://vin.openfest.org:8443 +args_template = "&target=$target$&source=0&width=300&height=120&hideAxes=true&lineWidth=1&hideLegend=true&hideAxes=false&colorList=049BAF&bgcolor=white&fgcolor=blue&minorLine=green" diff --git a/monitoring/icingaweb2/modules/monitoring/backends.ini b/monitoring/icingaweb2/modules/monitoring/backends.ini new file mode 100644 index 0000000..702a1a4 --- /dev/null +++ b/monitoring/icingaweb2/modules/monitoring/backends.ini @@ -0,0 +1,3 @@ +[icinga] +type = "ido" +resource = "icinga_ido" diff --git a/monitoring/icingaweb2/modules/monitoring/commandtransports.ini b/monitoring/icingaweb2/modules/monitoring/commandtransports.ini new file mode 100644 index 0000000..3d5d591 --- /dev/null +++ b/monitoring/icingaweb2/modules/monitoring/commandtransports.ini @@ -0,0 +1,3 @@ +[icinga2] +transport = "local" +path = "/var/run/icinga2/cmd/icinga2.cmd" diff --git a/monitoring/icingaweb2/modules/monitoring/config.ini b/monitoring/icingaweb2/modules/monitoring/config.ini new file mode 100644 index 0000000..9b69fe8 --- /dev/null +++ b/monitoring/icingaweb2/modules/monitoring/config.ini @@ -0,0 +1,2 @@ +[security] +protected_customvars = "*pw*,*pass*,community" diff --git a/monitoring/icingaweb2/resources.ini b/monitoring/icingaweb2/resources.ini new file mode 100644 index 0000000..2bcb533 --- /dev/null +++ b/monitoring/icingaweb2/resources.ini @@ -0,0 +1,21 @@ +[icingaweb_db] +type = "db" +db = "mysql" +host = "localhost" +port = "" +dbname = "icingaweb2" +username = "user" +password = "pass" +charset = "" +use_ssl = "0" + +[icinga_ido] +type = "db" +db = "mysql" +host = "localhost" +port = "" +dbname = "icinga2" +username = "user" +password = "pass" +charset = "utf8mb4" +use_ssl = "0" diff --git a/monitoring/icingaweb2/roles.ini b/monitoring/icingaweb2/roles.ini new file mode 100644 index 0000000..edf11ae --- /dev/null +++ b/monitoring/icingaweb2/roles.ini @@ -0,0 +1,4 @@ +[Administrators] +users = "openfest" +permissions = "*" +groups = "Administrators" diff --git a/monitoring/nginx-icinga-snippet.conf b/monitoring/nginx-icinga-snippet.conf new file mode 100644 index 0000000..9d742c7 --- /dev/null +++ b/monitoring/nginx-icinga-snippet.conf @@ -0,0 +1,15 @@ +location ~ ^/icingaweb2/index\.php(.*)$ { + fastcgi_pass unix:/run/php/php7.0-fpm.sock; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME /opt/openfest/icingaweb2/public/index.php; + fastcgi_param ICINGAWEB_CONFIGDIR /etc/icingaweb2; + fastcgi_param REMOTE_USER $remote_user; +} + +location ~ ^/icingaweb2(.+)? { + alias /opt/openfest/icingaweb2/public; + index index.php; + try_files $1 $uri $uri/ /icingaweb2/index.php$is_args$args; +} + diff --git a/switch-configs/coresw.cfg b/switch-configs/coresw.cfg new file mode 100644 index 0000000..63618ef --- /dev/null +++ b/switch-configs/coresw.cfg @@ -0,0 +1,445 @@ +! +! Last configuration change at 15:46:02 UTC Sat Oct 5 2019 +! NVRAM config last updated at 15:46:05 UTC Sat Oct 5 2019 +! +version 12.2 +no service pad +service timestamps debug datetime msec +service timestamps log datetime msec +no service password-encryption +service unsupported-transceiver +! +hostname coresw +! +boot-start-marker +boot-end-marker +! +enable password @_PW_@ +! +! +! +no aaa new-model +switch 1 provision ws-c3750e-48pd +system mtu routing 1500 +ip routing +! +! +ip name-server 10.20.0.1 +vtp mode off +! +! +! +! +spanning-tree mode mst +spanning-tree extend system-id +! +spanning-tree mst configuration + name openfest +! +! +! +! +! +vlan internal allocation policy ascending +! +vlan 2 + name initlab +! +vlan 10 + name of-ext +! +vlan 20 + name of-mgmt +! +vlan 21 + name of-wired +! +vlan 22 + name of-wifi +! +vlan 23 + name of-video +! +vlan 24 + name of-overflow +! +vlan 25 + name of-phones +! +vlan 26 + name security +! +vlan 29 + name of-prov +! +vlan 999 + name ipacct +! +vlan 2464 + name techpark +! +lldp run +! +! +! +interface FastEthernet0 + no ip address + no ip route-cache cef + no ip route-cache + no ip mroute-cache + shutdown +! +interface GigabitEthernet1/0/1 + description DEBUG + switchport access vlan 20 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/2 + description DEBUG/trunk + switchport trunk encapsulation dot1q + switchport mode trunk + no cdp enable + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/3 + description vin/backup + switchport trunk encapsulation dot1q + switchport mode trunk + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/4 + description debug/ipacct + switchport access vlan 999 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/5 + description ap-cf-srv + switchport trunk encapsulation dot1q + switchport trunk native vlan 29 + switchport trunk allowed vlan 20,22,29 + switchport mode trunk + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/6 + description ap-cf-f-l + switchport trunk encapsulation dot1q + switchport trunk native vlan 29 + switchport trunk allowed vlan 20,22,29 + switchport mode trunk + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/7 + description ap-cf-f-r + switchport trunk encapsulation dot1q + switchport trunk native vlan 29 + switchport trunk allowed vlan 20,22,29 + switchport mode trunk + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/8 + description ap-cf-b1 + switchport trunk encapsulation dot1q + switchport trunk native vlan 29 + switchport trunk allowed vlan 20,22,29 + switchport mode trunk + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/9 + description ap-cf-a1 + switchport trunk encapsulation dot1q + switchport trunk native vlan 29 + switchport trunk allowed vlan 20,22,29 + switchport mode trunk + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/10 + description ap-cf-a2 + switchport trunk encapsulation dot1q + switchport trunk native vlan 29 + switchport trunk allowed vlan 20,22,29 + switchport mode trunk + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/11 + description ap-cf-c1 + switchport trunk encapsulation dot1q + switchport trunk native vlan 29 + switchport trunk allowed vlan 20,22,29 + switchport mode trunk + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/12 + description ap-cf-qws + switchport trunk encapsulation dot1q + switchport trunk native vlan 29 + switchport trunk allowed vlan 20,22,29 + switchport mode trunk + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/13 + switchport trunk encapsulation dot1q + switchport trunk native vlan 29 + switchport trunk allowed vlan 20,22,29 + switchport mode trunk + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/14 + switchport trunk encapsulation dot1q + switchport trunk allowed vlan 20,22 + switchport mode trunk + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/15 + switchport trunk encapsulation dot1q + switchport trunk allowed vlan 20,22 + switchport mode trunk + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/16 + switchport trunk encapsulation dot1q + switchport trunk allowed vlan 20,22 + switchport mode trunk + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/17 + description reception-sw + switchport trunk encapsulation dot1q + switchport trunk allowed vlan 20-26 + switchport mode trunk + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/18 + description team-sw + switchport trunk encapsulation dot1q + switchport trunk allowed vlan 20-26 + switchport mode trunk + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/19 + description vocsw-A + switchport trunk encapsulation dot1q + switchport trunk allowed vlan 20-26 + switchport mode trunk + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/20 + description vocsw-B + switchport trunk encapsulation dot1q + switchport trunk allowed vlan 20-26 + switchport mode trunk + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/21 + description vocsw-C + switchport trunk encapsulation dot1q + switchport trunk allowed vlan 20-26 + switchport mode trunk + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/22 + description vocsw-D + switchport trunk encapsulation dot1q + switchport trunk allowed vlan 20-26 + switchport mode trunk + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/23 + switchport trunk encapsulation dot1q + switchport trunk allowed vlan 20-26 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/24 + description presenter-A + switchport access vlan 22 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/25 + description presenter-B + switchport access vlan 22 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/26 + description presenter-C + switchport access vlan 22 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/27 + description cambox-B + switchport access vlan 23 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/28 + description cambox-C + switchport access vlan 23 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/29 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/30 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/31 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/32 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/33 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/34 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/35 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/36 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/37 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/38 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/39 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/40 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/41 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/42 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/43 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/44 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/45 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/46 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/47 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/48 + description techpark + switchport access vlan 2464 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/49 + description f0sw + switchport trunk encapsulation dot1q + switchport trunk allowed vlan 20-26,29 + switchport mode trunk + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/50 + description ipacct + switchport access vlan 999 + switchport mode access + spanning-tree portfast trunk + spanning-tree bpdufilter enable + spanning-tree bpduguard enable +! +interface GigabitEthernet1/0/51 +! +interface GigabitEthernet1/0/52 +! +interface TenGigabitEthernet1/0/1 +! +interface TenGigabitEthernet1/0/2 + description vin + switchport trunk encapsulation dot1q + switchport mode trunk + spanning-tree portfast trunk +! +interface Vlan1 + no ip address +! +interface Vlan20 + ip address 10.20.0.11 255.255.255.0 +! +ip classless +! +ip http server +ip http secure-server +! +! +snmp-server community @_PW_@ RO +snmp-server trap-source Vlan20 +snmp-server enable traps snmp authentication linkdown linkup coldstart warmstart +snmp-server enable traps transceiver all +snmp-server enable traps tty +snmp-server enable traps license +snmp-server enable traps config-copy +snmp-server enable traps config +snmp-server enable traps fru-ctrl +snmp-server enable traps entity +snmp-server enable traps hsrp +snmp-server enable traps cpu threshold +snmp-server enable traps bridge newroot topologychange +snmp-server enable traps stpx inconsistency root-inconsistency loop-inconsistency +snmp-server enable traps syslog +snmp-server enable traps vtp +snmp-server enable traps vlancreate +snmp-server enable traps vlandelete +snmp-server enable traps flash insertion removal +snmp-server enable traps port-security +snmp-server enable traps envmon fan shutdown supply temperature status +snmp-server enable traps errdisable +snmp-server enable traps mac-notification change move threshold +snmp-server enable traps vlan-membership +snmp-server host 10.20.0.1 version 2c @_PW_@ +! +! +line con 0 +line vty 0 4 + password @_PW_@ + login +line vty 5 15 + password @_PW_@ + login +! +ntp server 10.20.0.1 +end diff --git a/switch-configs/f0sw.cfg b/switch-configs/f0sw.cfg new file mode 100644 index 0000000..4ea8262 --- /dev/null +++ b/switch-configs/f0sw.cfg @@ -0,0 +1,354 @@ +! +version 12.2 +no service pad +service timestamps debug datetime msec +service timestamps log datetime msec +no service password-encryption +! +hostname f0sw +! +boot-start-marker +boot-end-marker +! +enable password @_PW_@ +! +! +! +no aaa new-model +system mtu routing 1500 +vtp mode transparent +! +! +! +! +! +! +! +! +! +spanning-tree mode mst +spanning-tree extend system-id +! +spanning-tree mst configuration + name openfest +! +! +vlan internal allocation policy ascending +! +vlan 20 + name of-mgmt +! +vlan 21 + name of-wired +! +vlan 22 + name of-wireless +! +vlan 23 + name of-video +! +vlan 24 + name of-overflow +! +vlan 25 + name of-phone +! +vlan 26 + name of-security +! +vlan 29 + name of-prov +! +! +! +interface GigabitEthernet0/1 + description nocsw + switchport trunk encapsulation dot1q + switchport trunk allowed vlan 20-26,29 + switchport mode trunk + spanning-tree portfast trunk +! +interface GigabitEthernet0/2 + description ap-ws-ws1 + switchport trunk encapsulation dot1q + switchport trunk allowed vlan 20,22 + switchport mode trunk + spanning-tree portfast trunk +! +interface GigabitEthernet0/3 + description ap-ws-ws2 + switchport trunk encapsulation dot1q + switchport trunk allowed vlan 20,22 + switchport mode trunk + spanning-tree portfast trunk +! +interface GigabitEthernet0/4 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/5 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/6 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/7 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/8 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/9 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/10 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/11 + description wired-user + switchport access vlan 21 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet0/12 + description wired-user + switchport access vlan 21 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet0/13 + description wired-user + switchport access vlan 21 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet0/14 + description wired-user + switchport access vlan 21 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet0/15 + description wired-user + switchport access vlan 21 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet0/16 + description wired-user + switchport access vlan 21 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet0/17 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/18 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/19 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/20 + description ws-overflow + switchport access vlan 24 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet0/21 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/22 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/23 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/24 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/25 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/26 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/27 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/28 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/29 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/30 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/31 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/32 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/33 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/34 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/35 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/36 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/37 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/38 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/39 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/40 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/41 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/42 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/43 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/44 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/45 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/46 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/47 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/48 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/49 + description uplink + switchport trunk encapsulation dot1q + switchport mode trunk + spanning-tree portfast trunk +! +interface GigabitEthernet0/50 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/51 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet0/52 + shutdown + spanning-tree portfast trunk +! +interface Vlan1 + no ip address + shutdown +! +interface Vlan20 + ip address 10.20.0.27 255.255.255.0 +! +ip default-gateway 10.20.0.1 +ip classless +no ip http server +no ip http secure-server +! +! +! +snmp-server community @_PW_@ RO +snmp-server trap-source Vlan20 +snmp-server enable traps snmp authentication linkdown linkup coldstart warmstart +snmp-server enable traps transceiver all +snmp-server enable traps tty +snmp-server enable traps entity +snmp-server enable traps cpu threshold +snmp-server enable traps vtp +snmp-server enable traps vlancreate +snmp-server enable traps vlandelete +snmp-server enable traps flash insertion removal +snmp-server enable traps port-security +snmp-server enable traps auth-framework sec-violation +snmp-server enable traps envmon fan shutdown supply temperature status +snmp-server enable traps config-copy +snmp-server enable traps config +snmp-server enable traps config-ctid +snmp-server enable traps event-manager +snmp-server enable traps hsrp +snmp-server enable traps ipmulticast +snmp-server enable traps isis +snmp-server enable traps msdp +snmp-server enable traps pim neighbor-change rp-mapping-change invalid-pim-message +snmp-server enable traps vstack +snmp-server enable traps bridge newroot topologychange +snmp-server enable traps stpx inconsistency root-inconsistency loop-inconsistency +snmp-server enable traps syslog +snmp-server enable traps rtr +snmp-server enable traps mac-notification change move threshold +snmp-server enable traps vlan-membership +snmp-server enable traps errdisable +snmp-server host 10.20.0.1 version 2c @_PW_@ +! +! +line con 0 +line vty 0 4 + password @_PW_@ + login +line vty 5 15 + password @_PW_@ + login +! +ntp server 10.20.0.1 +end diff --git a/switch-configs/nocsw.cfg b/switch-configs/nocsw.cfg new file mode 100644 index 0000000..b11cf53 --- /dev/null +++ b/switch-configs/nocsw.cfg @@ -0,0 +1,320 @@ +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! +! NOCSW for OpenFest 2019 +! +! HW: WS-C3750G-24TS +! SW: c3750-ipservicesk9-mz.122-55.SE6.bin +! +! 2018.07.29 - Initial +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! +version 12.2 +no service pad +service timestamps debug datetime msec +service timestamps log datetime msec +no service password-encryption +! +hostname nocsw +! +boot-start-marker +boot-end-marker +! +enable password @EN_PW@ +! +! +! +no aaa new-model +switch 1 provision ws-c3750g-24ts +system mtu routing 1546 +vtp mode transparent +ip name-server 10.20.0.1 +! +! +! +! +crypto pki trustpoint TP-self-signed-448483968 + enrollment selfsigned + subject-name cn=IOS-Self-Signed-Certificate-448483968 + revocation-check none + rsakeypair TP-self-signed-448483968 +! +! +crypto pki certificate chain TP-self-signed-448483968 + certificate self-signed 01 + 3082023C 308201A5 A0030201 02020101 300D0609 2A864886 F70D0101 04050030 + 30312E30 2C060355 04031325 494F532D 53656C66 2D536967 6E65642D 43657274 + 69666963 6174652D 34343834 38333936 38301E17 0D393330 33303130 30303231 + 315A170D 32303031 30313030 30303030 5A303031 2E302C06 03550403 1325494F + 532D5365 6C662D53 69676E65 642D4365 72746966 69636174 652D3434 38343833 + 39363830 819F300D 06092A86 4886F70D 01010105 0003818D 00308189 02818100 + C23AA9B7 ADD891E1 33B799E2 57E2518E 0E66187B D98F2611 13329DFB 22AB44CD + B05F1A20 713812B3 B1316520 7CF4A44D 09B43B38 A51F5CE4 1AB2B6CE A517CE72 + 178BF3FC EABE83F0 3484E850 EA90B121 A7CC5A4A C59D51DA D571A3F6 6DB16B81 + E50F3AB7 9CBE1C54 E5B4044A 21885465 F799BF8D AC088EB0 E997975C B5EAE10D + 02030100 01A36630 64300F06 03551D13 0101FF04 05300301 01FF3011 0603551D + 11040A30 0882066E 6F637377 2E301F06 03551D23 04183016 80140B85 2A1FEAA2 + C57A710F 272188BA BD4C5B3E 16A2301D 0603551D 0E041604 140B852A 1FEAA2C5 + 7A710F27 2188BABD 4C5B3E16 A2300D06 092A8648 86F70D01 01040500 03818100 + 5D565D7E F937616F CDF07929 394894B7 00DDD4F3 5AF5EE67 9C3F2C56 3B183A86 + FF5F3B85 55857574 8C716002 A66A2A97 85D2BBAD 4972FAC8 744CC41E D0A9B51C + 65BF03DD 7924C33B 00150C57 A3815D7C AB54B1A7 B1F47487 9006F3AA 4B9BBB96 + C872A6DF 3501ABC0 8BD1BA44 9D920064 ECF3F134 900B220F 524D67B4 BE2C6C8D + quit +! +! +! +! +spanning-tree mode mst +spanning-tree extend system-id +! +vlan internal allocation policy ascending +! +vlan 10 + name external +! +vlan 20 + name of-mgmt +! +vlan 21 + name of-wired +! +vlan 22 + name of-wireless +! +vlan 23 + name of-video +! +vlan 24 + name of-overflow +! +vlan 25 + name of-phone +! +vlan 29 + name of-prov +! +! +! +! +interface GigabitEthernet1/0/1 + description phone/1 + switchport access vlan 25 + switchport trunk encapsulation dot1q + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/2 + description phone/2 + switchport access vlan 25 + switchport trunk encapsulation dot1q + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/3 + description ext/1 + switchport access vlan 10 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/4 + description ext/2 + switchport access vlan 23 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/5 + description of-mgmt/1 + switchport access vlan 20 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/6 + description of-mgmt/2 + switchport access vlan 20 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/7 + description of-wired/1 + switchport access vlan 21 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/8 + description of-wired/2 + switchport access vlan 21 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/9 + description of-wireless/1 + switchport access vlan 22 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/10 + description of-wireless/2 + switchport access vlan 22 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/11 + description of-video/1 + switchport access vlan 23 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/12 + description of-video/2 + switchport access vlan 23 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/13 + description of-video/3 + switchport access vlan 23 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/14 + description of-video/4 + switchport access vlan 23 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/15 + description of-overflow/1 + switchport access vlan 24 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/16 + description of-overflow/2 + switchport access vlan 24 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/17 + description noc-ap + switchport trunk encapsulation dot1q + switchport trunk allowed vlan 20,22 + switchport mode trunk +! +interface GigabitEthernet1/0/18 + description noc-int + switchport access vlan 20 + switchport mode access +! +interface GigabitEthernet1/0/19 + description noc-int + switchport access vlan 20 + switchport mode access +! +interface GigabitEthernet1/0/20 + description noc-int + switchport access vlan 20 + switchport mode access + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/21 + description noc-int + switchport access vlan 20 + switchport mode access +! +interface GigabitEthernet1/0/22 + description AP-FLASH + switchport access vlan 20 + switchport trunk encapsulation dot1q + switchport trunk native vlan 29 + switchport trunk allowed vlan 20,22,29 + switchport mode trunk +! +interface GigabitEthernet1/0/23 + description uplink + switchport trunk encapsulation dot1q + switchport trunk allowed vlan 20-25 + switchport mode trunk + no cdp enable + spanning-tree bpdufilter enable + spanning-tree bpduguard enable +! +interface GigabitEthernet1/0/24 + description uplink + switchport trunk encapsulation dot1q + switchport trunk allowed vlan 20-25 + switchport mode trunk + no cdp enable + spanning-tree bpdufilter enable + spanning-tree bpduguard enable +! +interface GigabitEthernet1/0/25 + shutdown +! +interface GigabitEthernet1/0/26 + shutdown + spanning-tree portfast trunk +! +interface GigabitEthernet1/0/27 + shutdown +! +interface GigabitEthernet1/0/28 + shutdown +! +interface Vlan1 + no ip address + shutdown +! +interface Vlan20 + ip address 10.20.0.28 255.255.255.0 +! +ip default-gateway 10.20.0.1 +ip classless +no ip http server +no ip http secure-server +! +! +! +snmp-server community @SNMP_PW@ RO +snmp-server trap-source Vlan20 +snmp-server enable traps snmp authentication linkdown linkup coldstart warmstart +snmp-server enable traps transceiver all +snmp-server enable traps tty +snmp-server enable traps fru-ctrl +snmp-server enable traps entity +snmp-server enable traps cpu threshold +snmp-server enable traps vtp +snmp-server enable traps vlancreate +snmp-server enable traps vlandelete +snmp-server enable traps flash insertion removal +snmp-server enable traps port-security +snmp-server enable traps auth-framework sec-violation +snmp-server enable traps envmon fan shutdown supply temperature status +snmp-server enable traps license +snmp-server enable traps config-copy +snmp-server enable traps config +snmp-server enable traps config-ctid +snmp-server enable traps event-manager +snmp-server enable traps hsrp +snmp-server enable traps ipmulticast +snmp-server enable traps isis +snmp-server enable traps msdp +snmp-server enable traps pim neighbor-change rp-mapping-change invalid-pim-message +snmp-server enable traps vstack +snmp-server enable traps bridge newroot topologychange +snmp-server enable traps stpx inconsistency root-inconsistency loop-inconsistency +snmp-server enable traps syslog +snmp-server enable traps rtr +snmp-server enable traps mac-notification change move threshold +snmp-server enable traps vlan-membership +snmp-server enable traps errdisable +snmp-server host 10.20.0.1 version 2c @SNMP_PW@ +! +! +line con 0 +line vty 0 4 + password @PW@ + login +line vty 5 15 + password @PW@ + login +! +end diff --git a/switch-configs/receptionsw.cfg b/switch-configs/receptionsw.cfg new file mode 100644 index 0000000..e260822 --- /dev/null +++ b/switch-configs/receptionsw.cfg @@ -0,0 +1,172 @@ +!TL-SG3210 +##################################################################### +# +# RECEPTIONSW for OpenFest 2019 +# +# HW: TL-SG3210 1.0 +# SW: 1.9.2 Build 20130527 Rel.59782 +# +# 2018.07.29 - Initial +# +##################################################################### +# +vlan 2,10,20-25 +# +vlan 2 +name "initlab" +# +vlan 10 +name "of-ext" +# +vlan 20 +name "of-mgmt" +# +vlan 21 +name "of-wired" +# +vlan 22 +name "of-wifi" +# +vlan 23 +name "of-video" +# +vlan 24 +name "of-overflow" +# +vlan 25 +name "of-phones" +# +# +# +hostname "receptionsw" +# +mac address-table aging-time 300 +# +logging buffer 6 +no logging file flash +# +enable password @EN_PW@ +# +system-time ntp UTC+02:00 10.20.0.1 185.117.82.66 4 +# +spanning-tree +spanning-tree mode mstp +spanning-tree mst configuration +name openfest +# +# +# +# +# +# +# +# +snmp-server +snmp-server engineID local 80002e5703c46e1f44c0e8 +snmp-server community @SNMP_PW@ read-only viewDefault +# +snmp-server host 10.20.0.1 161 monitoring smode v2c slev noAuthNoPriv type trap +snmp-server traps flash +snmp-server traps spanning-tree topologychange +snmp-server traps cpu +snmp-server traps vlan create +snmp-server traps vlan delete +# +interface gigabitEthernet 1/0/1 + switchport access vlan 25 + description "reception/phone" + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/2 + switchport access vlan 25 + description "reception/printer" + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/3 + switchport access vlan 21 + spanning-tree + spanning-tree common-config portfast enable + description "reception/pc1" + +# +interface gigabitEthernet 1/0/4 + switchport access vlan 21 + spanning-tree + spanning-tree common-config portfast enable + description "reception/pc2" + +# +interface gigabitEthernet 1/0/5 + switchport access vlan 21 + spanning-tree + spanning-tree common-config portfast enable + description "reception/pc3" + +# +interface gigabitEthernet 1/0/6 + shutdown + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/7 + shutdown + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/8 + switchport mode trunk + switchport trunk allowed vlan 20,21,25 + description "reception/uplink" + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/9 + speed 1000 + shutdown + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/10 + speed 1000 + shutdown + spanning-tree + spanning-tree common-config portfast enable + +# +ip management-vlan 20 +interface vlan 20 +ip address 10.20.0.25 255.255.255.0 10.20.0.1 +# +line vty 0 0 +password @PW@ +login +# +line vty 1 1 +password @PW@ +login +# +line vty 2 2 +password @PW@ +login +# +line vty 3 3 +password @PW@ +login +# +line vty 4 4 +password @PW@ +login +# +line vty 5 5 +password @PW@ +login +# +end diff --git a/switch-configs/teamsw.cfg b/switch-configs/teamsw.cfg new file mode 100644 index 0000000..fdf59a7 --- /dev/null +++ b/switch-configs/teamsw.cfg @@ -0,0 +1,171 @@ +!TL-SG3210 +##################################################################### +# +# TEAMSW for OpenFest 2019 +# +# HW: TL-SG3210 1.0 +# SW: 1.9.2 Build 20130527 Rel.59782 +# +# 2018.07.29 - Initial +# +##################################################################### +# +vlan 2,10,20-25 +# +vlan 2 +name "initlab" +# +vlan 10 +name "of-ext" +# +vlan 20 +name "of-mgmt" +# +vlan 21 +name "of-wired" +# +vlan 22 +name "of-wifi" +# +vlan 23 +name "of-video" +# +vlan 24 +name "of-overflow" +# +vlan 25 +name "of-phones" +# +# +# +hostname "teamsw" +# +mac address-table aging-time 300 +# +logging buffer 6 +no logging file flash +# +enable password @EN_PW@ +# +system-time ntp UTC+02:00 10.20.0.1 185.117.82.66 4 +# +spanning-tree +spanning-tree mode mstp +spanning-tree mst configuration +name openfest +# +# +# +# +# +# +# +# +snmp-server +snmp-server engineID local 80002e5703c46e1f44c0e8 +snmp-server community @SNMP_PW@ read-only viewDefault +# +snmp-server host 10.20.0.1 161 monitoring smode v2c slev noAuthNoPriv type trap +snmp-server traps flash +snmp-server traps spanning-tree topologychange +snmp-server traps cpu +snmp-server traps vlan create +snmp-server traps vlan delete +# +interface gigabitEthernet 1/0/1 + switchport access vlan 25 + description "teamsw/phone" + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/2 + switchport mode trunk + switchport trunk allowed vlan 20,22 + description "teamsw/ap-cf-ch" + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/3 + switchport access vlan 24 + spanning-tree + spanning-tree common-config portfast enable + description "teamsw/overflow" + +# +interface gigabitEthernet 1/0/4 + shutdown + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/5 + shutdown + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/6 + shutdown + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/7 + shutdown + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/8 + switchport mode trunk + switchport trunk allowed vlan 20,22,24,25 + description "teamsw/uplink" + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/9 + speed 1000 + shutdown + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/10 + speed 1000 + shutdown + spanning-tree + spanning-tree common-config portfast enable + +# +ip management-vlan 20 +interface vlan 20 +ip address 10.20.0.26 255.255.255.0 10.20.0.1 +# +line vty 0 0 +password @PW@ +login +# +line vty 1 1 +password @PW@ +login +# +line vty 2 2 +password @PW@ +login +# +line vty 3 3 +password @PW@ +login +# +line vty 4 4 +password @PW@ +login +# +line vty 5 5 +password @PW@ +login +# +end diff --git a/switch-configs/uplink-gkc.cfg b/switch-configs/uplink-gkc.cfg new file mode 100644 index 0000000..a46eaf9 --- /dev/null +++ b/switch-configs/uplink-gkc.cfg @@ -0,0 +1,204 @@ +Current configuration : 4369 bytes +! +version 12.2 +no service pad +service timestamps debug datetime msec +service timestamps log datetime msec +no service password-encryption +! +hostname uplink-gkc +! +boot-start-marker +boot-end-marker +! +enable password @_PW_@ +! +! +! +no aaa new-model +system mtu routing 1600 +authentication mac-move permit +ip subnet-zero +! +! +! +! +crypto pki trustpoint TP-self-signed-2819320576 + enrollment selfsigned + subject-name cn=IOS-Self-Signed-Certificate-2819320576 + revocation-check none + rsakeypair TP-self-signed-2819320576 +! +! +crypto pki certificate chain TP-self-signed-2819320576 + certificate self-signed 01 + 3082023F 308201A8 A0030201 02020101 300D0609 2A864886 F70D0101 04050030 + 31312F30 2D060355 04031326 494F532D 53656C66 2D536967 6E65642D 43657274 + 69666963 6174652D 32383139 33323035 3736301E 170D3933 30333031 30303030 + 35375A17 0D323030 31303130 30303030 305A3031 312F302D 06035504 03132649 + 4F532D53 656C662D 5369676E 65642D43 65727469 66696361 74652D32 38313933 + 32303537 3630819F 300D0609 2A864886 F70D0101 01050003 818D0030 81890281 + 8100BADE B5858C98 AA7562A0 04C3536E 774CF98B 97E9532F 589B860A 56AA12A0 + 2868F081 F8B13DE1 1B6B3931 CBD40746 24F0BD83 DE670FF3 227B3FDF 6480D7B7 + 7D8EB91D 8F438705 FFC55422 4F975FA0 4A2A3927 7E445FEF F75842FB 5834C721 + D6500BB2 B677A5AC FC88A761 429CCB97 8D456903 8F23855D 9880088C 43C531FE + 6FDD0203 010001A3 67306530 0F060355 1D130101 FF040530 030101FF 30120603 + 551D1104 0B300982 07537769 7463682E 301F0603 551D2304 18301680 1476D683 + 370456AA B8A6637A D95ECDD9 6A167B46 E6301D06 03551D0E 04160414 76D68337 + 0456AAB8 A6637AD9 5ECDD96A 167B46E6 300D0609 2A864886 F70D0101 04050003 + 81810053 57DCF9D9 9F668A2D 169D9B1B B96C3194 7A2E28E0 C9C6F632 72378C7C + F5CFDD5B A8D1888E 1F75ECFA E15B4154 8D7F4D36 35C1C633 4E533627 9F3F68D8 + 96A0A7AC D55A36C4 988BBB61 E43C7B5F A5E839DD 1DE43B05 6301BDE7 C147EDFF + B5C53426 8B50AD26 2D7DB62A DBA6C523 D2C247C5 6620A2AE AC96E56C 08C25E39 645914 + quit +! +! +! +spanning-tree mode pvst +spanning-tree etherchannel guard misconfig +spanning-tree extend system-id +! +vlan internal allocation policy ascending +! +! +! +! +interface FastEthernet0/1 + description debug + switchport access vlan 999 + switchport mode access + spanning-tree portfast +! +interface FastEthernet0/2 + shutdown + spanning-tree portfast +! +interface FastEthernet0/3 + shutdown + spanning-tree portfast +! +interface FastEthernet0/4 + shutdown + spanning-tree portfast +! +interface FastEthernet0/5 + shutdown + spanning-tree portfast +! +interface FastEthernet0/6 + shutdown + spanning-tree portfast +! +interface FastEthernet0/7 + shutdown + spanning-tree portfast +! +interface FastEthernet0/8 + shutdown + spanning-tree portfast +! +interface FastEthernet0/9 + shutdown + spanning-tree portfast +! +interface FastEthernet0/10 + shutdown + spanning-tree portfast +! +interface FastEthernet0/11 + shutdown + spanning-tree portfast +! +interface FastEthernet0/12 + shutdown + spanning-tree portfast +! +interface FastEthernet0/13 + shutdown + spanning-tree portfast +! +interface FastEthernet0/14 + shutdown + spanning-tree portfast +! +interface FastEthernet0/15 + shutdown + spanning-tree portfast +! +interface FastEthernet0/16 + shutdown + spanning-tree portfast +! +interface FastEthernet0/17 + shutdown + spanning-tree portfast +! +interface FastEthernet0/18 + shutdown + spanning-tree portfast +! +interface FastEthernet0/19 + shutdown + spanning-tree portfast +! +interface FastEthernet0/20 + shutdown + spanning-tree portfast +! +interface FastEthernet0/21 + shutdown + spanning-tree portfast +! +interface FastEthernet0/22 + shutdown + spanning-tree portfast +! +interface FastEthernet0/23 + shutdown + spanning-tree portfast +! +interface FastEthernet0/24 + shutdown + spanning-tree portfast +! +interface GigabitEthernet0/1 + description switchboard + switchport access vlan 999 + switchport mode access + no cdp enable + spanning-tree portfast trunk +! +interface GigabitEthernet0/2 + description hall + switchport access vlan 999 + switchport mode access + no cdp enable + spanning-tree portfast trunk +! +interface Vlan1 + no ip address +! +interface Vlan999 + ip address 172.31.42.101 255.255.255.0 +! +ip classless +ip route 0.0.0.0 0.0.0.0 10.21.0.1 254 +ip http server +ip http secure-server +! +! +ip sla enable reaction-alerts +! +snmp-server community @_PW_@ RO +snmp-server location techpark-gkc +! +! +line con 0 +line vty 0 4 + password @_PW_@ + login +line vty 5 15 + password @_PW_@ + login +! +end diff --git a/switch-configs/uplink-sw.cfg b/switch-configs/uplink-sw.cfg new file mode 100644 index 0000000..16946fa --- /dev/null +++ b/switch-configs/uplink-sw.cfg @@ -0,0 +1,142 @@ +!TL-SG3210 +# +vlan 999 +# +vlan 999 +name "uplink" +# +# +# +# +hostname "uplink-sw" +location "techpark-swichboard" +# +mac address-table aging-time 300 +# +logging buffer 6 +no logging file flash +# +enable password @_PW_@ +# +system-time ntp UTC+08:00 133.100.9.2 139.78.100.163 12 +# +# +# +# +# +# +# +# +snmp-server +snmp-server engineID local 80002e5703c4e984a95eeb +snmp-server community "@_PW_@" read-only "viewDefault" +# +ip ssh server +# +interface gigabitEthernet 1/0/1 + switchport access vlan 999 + description "debug" +# +interface gigabitEthernet 1/0/2 + shutdown +# +interface gigabitEthernet 1/0/3 + shutdown +# +interface gigabitEthernet 1/0/4 + shutdown +# +interface gigabitEthernet 1/0/5 + shutdown +# +interface gigabitEthernet 1/0/6 + shutdown +# +interface gigabitEthernet 1/0/7 + shutdown +# +interface gigabitEthernet 1/0/8 + shutdown +# +interface gigabitEthernet 1/0/9 + switchport access vlan 999 + description "ipacct" + speed 1000 + duplex full +# +interface gigabitEthernet 1/0/10 + switchport access vlan 999 + description "gkc" + speed 1000 + duplex full +# +ip management-vlan 999 +interface vlan 999 +ip address 172.31.42.102 255.255.255.0 +# +# +line vty 0 0 +password @_PW_@ +login +# +line vty 1 1 +password @_PW_@ +login +# +line vty 2 2 +password @_PW_@ +login +# +line vty 3 3 +password @_PW_@ +login +# +line vty 4 4 +password @_PW_@ +login +# +line vty 5 5 +password @_PW_@ +login +# +line vty 6 6 +password @_PW_@ +login +# +line vty 7 7 +password @_PW_@ +login +# +line vty 8 8 +password @_PW_@ +login +# +line vty 9 9 +password @_PW_@ +login +# +line vty 10 10 +password @_PW_@ +login +# +line vty 11 11 +password @_PW_@ +login +# +line vty 12 12 +password @_PW_@ +login +# +line vty 13 13 +password @_PW_@ +login +# +line vty 14 14 +password @_PW_@ +login +# +line vty 15 15 +password @_PW_@ +login +# +end diff --git a/switch-configs/vocsw-A.cfg b/switch-configs/vocsw-A.cfg new file mode 100644 index 0000000..2c8d4ca --- /dev/null +++ b/switch-configs/vocsw-A.cfg @@ -0,0 +1,174 @@ +!TL-SG3210 +##################################################################### +# +# VOCSW-A for OpenFest 2019 +# +# HW: TL-SG3210 1.0 +# SW: 1.9.2 Build 20130527 Rel.59782 +# +# 2018.07.29 - Initial +# +##################################################################### +# +vlan 2,10,20-25 +# +vlan 2 +name "initlab" +# +vlan 10 +name "of-ext" +# +vlan 20 +name "of-mgmt" +# +vlan 21 +name "of-wired" +# +vlan 22 +name "of-wifi" +# +vlan 23 +name "of-video" +# +vlan 24 +name "of-overflow" +# +vlan 25 +name "of-phones" +# +# +# +hostname "vocsw-A" +# +mac address-table aging-time 300 +# +logging buffer 6 +no logging file flash +# +enable password @EN_PW@ +# +system-time ntp UTC+02:00 10.20.0.1 185.117.82.66 4 +# +spanning-tree +spanning-tree mode mstp +spanning-tree mst configuration +name openfest +# +# +# +# +# +# +# +# +snmp-server +snmp-server engineID local 80002e5703c46e1f44c0e8 +snmp-server community @SNMP_PW@ read-only viewDefault +# +snmp-server host 10.20.0.1 161 monitoring smode v2c slev noAuthNoPriv type trap +snmp-server traps flash +snmp-server traps spanning-tree topologychange +snmp-server traps cpu +snmp-server traps vlan create +snmp-server traps vlan delete +# +interface gigabitEthernet 1/0/1 + switchport access vlan 25 + description "voc-A/phone" + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/2 + switchport access vlan 23 + description "voc-A/streamer" + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/3 + switchport access vlan 23 + spanning-tree + spanning-tree common-config portfast enable + description "voc-A/videoswitcher" + +# +interface gigabitEthernet 1/0/4 + switchport access vlan 23 + spanning-tree + spanning-tree common-config portfast enable + description "voc-A/scaler" + +# +interface gigabitEthernet 1/0/5 + switchport access vlan 23 + spanning-tree + spanning-tree common-config portfast enable + description "voc-A/control-1" + +# +interface gigabitEthernet 1/0/6 + switchport access vlan 23 + spanning-tree + spanning-tree common-config portfast enable + description "voc-A/control-2" + +# +interface gigabitEthernet 1/0/7 + switchport access vlan 23 + spanning-tree + spanning-tree common-config portfast enable + description "voc-A/control-3" + +# +interface gigabitEthernet 1/0/8 + switchport mode trunk + switchport trunk allowed vlan 20,23,25 + description "voc-A/uplink" + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/9 + speed 1000 + shutdown + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/10 + speed 1000 + shutdown + spanning-tree + spanning-tree common-config portfast enable + +# +ip management-vlan 20 +interface vlan 20 +ip address 10.20.0.21 255.255.255.0 10.20.0.1 +# +line vty 0 0 +password @PW@ +login +# +line vty 1 1 +password @PW@ +login +# +line vty 2 2 +password @PW@ +login +# +line vty 3 3 +password @PW@ +login +# +line vty 4 4 +password @PW@ +login +# +line vty 5 5 +password @PW@ +login +# +end diff --git a/switch-configs/vocsw-B.cfg b/switch-configs/vocsw-B.cfg new file mode 100644 index 0000000..5ff9fa4 --- /dev/null +++ b/switch-configs/vocsw-B.cfg @@ -0,0 +1,174 @@ +!TL-SG3210 +##################################################################### +# +# VOCSW-B for OpenFest 2019 +# +# HW: TL-SG3210 1.0 +# SW: 1.9.2 Build 20130527 Rel.59782 +# +# 2018.07.29 - Initial +# +##################################################################### +# +vlan 2,10,20-25 +# +vlan 2 +name "initlab" +# +vlan 10 +name "of-ext" +# +vlan 20 +name "of-mgmt" +# +vlan 21 +name "of-wired" +# +vlan 22 +name "of-wifi" +# +vlan 23 +name "of-video" +# +vlan 24 +name "of-overflow" +# +vlan 25 +name "of-phones" +# +# +# +hostname "vocsw-B" +# +mac address-table aging-time 300 +# +logging buffer 6 +no logging file flash +# +enable password @EN_PW@ +# +system-time ntp UTC+02:00 10.20.0.1 185.117.82.66 4 +# +spanning-tree +spanning-tree mode mstp +spanning-tree mst configuration +name openfest +# +# +# +# +# +# +# +# +snmp-server +snmp-server engineID local 80002e5703c46e1f44c0e8 +snmp-server community @SNMP_PW@ read-only viewDefault +# +snmp-server host 10.20.0.1 161 monitoring smode v2c slev noAuthNoPriv type trap +snmp-server traps flash +snmp-server traps spanning-tree topologychange +snmp-server traps cpu +snmp-server traps vlan create +snmp-server traps vlan delete +# +interface gigabitEthernet 1/0/1 + switchport access vlan 25 + description "voc-B/phone" + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/2 + switchport access vlan 23 + description "voc-B/streamer" + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/3 + switchport access vlan 23 + spanning-tree + spanning-tree common-config portfast enable + description "voc-B/videoswitcher" + +# +interface gigabitEthernet 1/0/4 + switchport access vlan 23 + spanning-tree + spanning-tree common-config portfast enable + description "voc-B/scaler" + +# +interface gigabitEthernet 1/0/5 + switchport access vlan 23 + spanning-tree + spanning-tree common-config portfast enable + description "voc-B/control-1" + +# +interface gigabitEthernet 1/0/6 + switchport access vlan 23 + spanning-tree + spanning-tree common-config portfast enable + description "voc-B/control-2" + +# +interface gigabitEthernet 1/0/7 + switchport access vlan 23 + spanning-tree + spanning-tree common-config portfast enable + description "voc-B/control-3" + +# +interface gigabitEthernet 1/0/8 + switchport mode trunk + switchport trunk allowed vlan 20,23,25 + description "voc-B/uplink" + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/9 + speed 1000 + shutdown + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/10 + speed 1000 + shutdown + spanning-tree + spanning-tree common-config portfast enable + +# +ip management-vlan 20 +interface vlan 20 +ip address 10.20.0.22 255.255.255.0 10.20.0.1 +# +line vty 0 0 +password @PW@ +login +# +line vty 1 1 +password @PW@ +login +# +line vty 2 2 +password @PW@ +login +# +line vty 3 3 +password @PW@ +login +# +line vty 4 4 +password @PW@ +login +# +line vty 5 5 +password @PW@ +login +# +end diff --git a/switch-configs/vocsw-C.cfg b/switch-configs/vocsw-C.cfg new file mode 100644 index 0000000..d40347b --- /dev/null +++ b/switch-configs/vocsw-C.cfg @@ -0,0 +1,174 @@ +!TL-SG3210 +##################################################################### +# +# VOCSW-C for OpenFest 2019 +# +# HW: TL-SG3210 1.0 +# SW: 1.9.2 Build 20130527 Rel.59782 +# +# 2018.07.29 - Initial +# +##################################################################### +# +vlan 2,10,20-25 +# +vlan 2 +name "initlab" +# +vlan 10 +name "of-ext" +# +vlan 20 +name "of-mgmt" +# +vlan 21 +name "of-wired" +# +vlan 22 +name "of-wifi" +# +vlan 23 +name "of-video" +# +vlan 24 +name "of-overflow" +# +vlan 25 +name "of-phones" +# +# +# +hostname "vocsw-C" +# +mac address-table aging-time 300 +# +logging buffer 6 +no logging file flash +# +enable password @EN_PW@ +# +system-time ntp UTC+02:00 10.20.0.1 185.117.82.66 4 +# +spanning-tree +spanning-tree mode mstp +spanning-tree mst configuration +name openfest +# +# +# +# +# +# +# +# +snmp-server +snmp-server engineID local 80002e5703c46e1f44c0e8 +snmp-server community @SNMP_PW@ read-only viewDefault +# +snmp-server host 10.20.0.1 161 monitoring smode v2c slev noAuthNoPriv type trap +snmp-server traps flash +snmp-server traps spanning-tree topologychange +snmp-server traps cpu +snmp-server traps vlan create +snmp-server traps vlan delete +# +interface gigabitEthernet 1/0/1 + switchport access vlan 25 + description "voc-C/phone" + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/2 + switchport access vlan 23 + description "voc-C/voctop" + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/3 + switchport access vlan 23 + spanning-tree + spanning-tree common-config portfast enable + description "voc-C/cambox" + +# +interface gigabitEthernet 1/0/4 + switchport access vlan 23 + spanning-tree + spanning-tree common-config portfast enable + description "voc-C/slidesbox" + +# +interface gigabitEthernet 1/0/5 + switchport access vlan 23 + spanning-tree + spanning-tree common-config portfast enable + description "voc-C/control-1" + +# +interface gigabitEthernet 1/0/6 + switchport access vlan 23 + spanning-tree + spanning-tree common-config portfast enable + description "voc-C/control-2" + +# +interface gigabitEthernet 1/0/7 + switchport access vlan 23 + spanning-tree + spanning-tree common-config portfast enable + description "voc-C/control-3" + +# +interface gigabitEthernet 1/0/8 + switchport mode trunk + switchport trunk allowed vlan 20,23,25 + description "voc-C/uplink" + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/9 + speed 1000 + shutdown + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/10 + speed 1000 + shutdown + spanning-tree + spanning-tree common-config portfast enable + +# +ip management-vlan 20 +interface vlan 20 +ip address 10.20.0.23 255.255.255.0 10.20.0.1 +# +line vty 0 0 +password @PW@ +login +# +line vty 1 1 +password @PW@ +login +# +line vty 2 2 +password @PW@ +login +# +line vty 3 3 +password @PW@ +login +# +line vty 4 4 +password @PW@ +login +# +line vty 5 5 +password @PW@ +login +# +end diff --git a/switch-configs/vocsw-D.cfg b/switch-configs/vocsw-D.cfg new file mode 100644 index 0000000..575bbe3 --- /dev/null +++ b/switch-configs/vocsw-D.cfg @@ -0,0 +1,171 @@ +!TL-SG3210 +##################################################################### +# +# VOCSW-D for OpenFest 2019 +# +# HW: TL-SG3210 1.0 +# SW: 1.9.2 Build 20130527 Rel.59782 +# +# 2018.07.29 - Initial +# +##################################################################### +# +vlan 2,10,20-25 +# +vlan 2 +name "initlab" +# +vlan 10 +name "of-ext" +# +vlan 20 +name "of-mgmt" +# +vlan 21 +name "of-wired" +# +vlan 22 +name "of-wifi" +# +vlan 23 +name "of-video" +# +vlan 24 +name "of-overflow" +# +vlan 25 +name "of-phones" +# +# +# +# +hostname "vocsw-D" +# +mac address-table aging-time 300 +# +logging buffer 6 +no logging file flash +# +enable password @EN_PW@ +# +system-time ntp UTC+02:00 10.20.0.1 185.117.82.66 4 +# +spanning-tree +spanning-tree mode mstp +spanning-tree mst configuration +name openfest +# +# +# +# +# +# +# +# +snmp-server +snmp-server engineID local 80002e5703c46e1f44c0e8 +snmp-server community @SNMP_PW@ read-only viewDefault +# +snmp-server host 10.20.0.1 161 monitoring smode v2c slev noAuthNoPriv type trap +snmp-server traps flash +snmp-server traps spanning-tree topologychange +snmp-server traps cpu +snmp-server traps vlan create +snmp-server traps vlan delete +# +interface gigabitEthernet 1/0/1 + switchport access vlan 25 + description "voc-D/phone" + spanning-tree + spanning-tree common-config portfast enable +# +interface gigabitEthernet 1/0/2 + switchport access vlan 21 + description "gaming-workshop" + spanning-tree + spanning-tree common-config portfast enable +# +interface gigabitEthernet 1/0/3 + switchport access vlan 23 + description "voc-D/cambox" + spanning-tree + spanning-tree common-config portfast enable +# +interface gigabitEthernet 1/0/4 + switchport access vlan 23 + description "voc-D/slidesbox" + spanning-tree + spanning-tree common-config portfast enable +# +interface gigabitEthernet 1/0/5 + switchport access vlan 23 + description "voc-D/control-1" + spanning-tree + spanning-tree common-config portfast enable +# +interface gigabitEthernet 1/0/6 + switchport access vlan 23 + description "voc-D/control-2" + spanning-tree + spanning-tree common-config portfast enable +# +interface gigabitEthernet 1/0/7 + switchport access vlan 23 + description "voc-D/control-3" + spanning-tree + spanning-tree common-config portfast enable +# +interface gigabitEthernet 1/0/8 + switchport mode trunk + switchport trunk allowed vlan 20-21,23,25 + switchport pvid 23 + description "voc-D/uplink" + speed 1000 + duplex full + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/9 + speed 1000 + shutdown + spanning-tree + spanning-tree common-config portfast enable + +# +interface gigabitEthernet 1/0/10 + speed 1000 + shutdown + spanning-tree + spanning-tree common-config portfast enable + +# +ip management-vlan 20 +interface vlan 20 +ip address 10.20.0.24 255.255.255.0 10.20.0.1 +# +line vty 0 0 +password @PW@ +login +# +line vty 1 1 +password @PW@ +login +# +line vty 2 2 +password @PW@ +login +# +line vty 3 3 +password @PW@ +login +# +line vty 4 4 +password @PW@ +login +# +line vty 5 5 +password @PW@ +login +# +end