diff --git a/application/controllers/NagiosCliController.php b/application/controllers/NagiosCliController.php deleted file mode 100644 index 4d5e3d982..000000000 --- a/application/controllers/NagiosCliController.php +++ /dev/null @@ -1,202 +0,0 @@ - - * @category IXP - * @package IXP_Controller - * @copyright Copyright (C) 2009-2016 Internet Neutral Exchange Association Company Limited By Guarantee - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU GPL V2.0 - */ -class NagiosCliController extends IXP_Controller_CliAction -{ - - /** - * Generates a Nagios configuration for supported switches in the database - */ - public function genSwitchConfigAction() - { - $this->view->ixp = $ixp = $this->cliResolveIXP(); - - // we want a fresh switch list here - $this->getD2EM()->getRepository( '\\Entities\\Switcher' )->clearCache( true ); - $switches = $this->getD2EM()->getRepository( '\\Entities\\Switcher' )->getAndCache( true ); - - echo $this->view->render( 'nagios-cli/conf/switch-definitions.phtml' ); - - $vendors = []; - $vendor_strings = []; - $all = []; - - foreach( $switches as $s ) - { - $this->view->sw = $s; - echo $this->view->render( 'nagios-cli/conf/switch-hosts.phtml' ); - - $vendors[ $s->getVendor()->getShortname() ][] = $s; - - if( !isset( $vendor_strings[ $s->getVendor()->getShortname() ] ) ) - $vendor_strings[ $s->getVendor()->getShortname() ] = ''; - - $vendor_strings[ $s->getVendor()->getShortname() ] - .= ( strlen( $vendor_strings[ $s->getVendor()->getShortname() ] ) ? ', ' : '' ) . $s->getName(); - - $all[] = $s->getName(); - - if( isset( $locations[ $s->getCabinet()->getLocation()->getShortname() ] ) ) - $locations[ $s->getCabinet()->getLocation()->getShortname() ] .= ", " . $s->getName(); - else - $locations[ $s->getCabinet()->getLocation()->getShortname() ] = $s->getName(); - } - - $this->view->locations = $locations; - - $this->view->vendors = $vendors; - $this->view->vendor_strings = $vendor_strings; - $this->view->all = implode( ', ', $all ); - - echo $this->view->render( 'nagios-cli/conf/switch-templates.phtml' ); - } - - public function genMemberConfigAction() - { - $this->view->ixp = $ixp = $this->cliResolveIXP(); - - $this->genMemberConf_getVlanInterfaces( $ixp ); - - //print_r( $this->getD2R( '\\Entities\\VlanInterface' )->getForIXP( $ixp ) ); die(); - - echo $this->view->render( 'nagios-cli/conf/members.cfg' ); - } - - /** - * Utility function to slurp all peering VLAN interfaces ports from the database and - * arrange them in arrays for use by the Nagios config templates - * - * @param \Entities\IXP $ixp - */ - private function genMemberConf_getVlanInterfaces( $ixp ) - { - $custs = []; - $switches = []; - $cabinets = []; - $locations = []; - $ipv4hosts = []; - $ipv6hosts = []; - - foreach( $ixp->getCustomers() as $c ) - { - if( !( $c->isTypeFull() || $c->isTypeProBono() ) || $c->hasLeft() || $c->getStatus() != \Entities\Customer::STATUS_NORMAL ) - continue; - - $custs[ $c->getId() ]['shortname'] = $c->getShortname(); - $custs[ $c->getId() ]['name'] = $c->getAbbreviatedName(); - - $custs[ $c->getId() ]['hostnames'] = []; - $custs[ $c->getId() ]['vints'] = []; - - foreach( $c->getVirtualInterfaces() as $vi ) - { - // make sure we have a phsyical connection - $haveConnection = false; - - foreach( $vi->getPhysicalInterfaces() as $pi ) - { - if( $pi->getStatus() == \Entities\PhysicalInterface::STATUS_CONNECTED ) - $haveConnection = true; - } - - if( !$haveConnection ) - continue; - - foreach( $vi->getVlanInterfaces() as $vli ) - { - if( $vli->getVlan()->getPrivate() ) - continue; - - foreach( [ 'v4', 'v6' ] as $proto ) - { - $getIpEnabled = "getIp{$proto}enabled"; - $getIpCanping = "getIp{$proto}canping"; - $getIpAddress = "getIP{$proto}Address"; - $getIpMonBGP = "getIp{$proto}monitorrcbgp"; - - if( $vli->$getIpEnabled() && $vli->$getIpCanping() ) - { - if( !$vli->$getIpAddress() ) - continue; - - $hn = "{$c->getShortname()}-ip{$proto}-vlan{$vli->getVlan()->getNumber()}-{$vli->getId()}"; - $custs[ $c->getId() ]['hostnames'][] = $hn; - - $custs[ $c->getId() ]['vints'][ $vli->getId() ][$proto]['hostname'] = $hn; - $custs[ $c->getId() ]['vints'][ $vli->getId() ][$proto]['address'] = $vli->$getIpAddress()->getAddress(); - $custs[ $c->getId() ]['vints'][ $vli->getId() ][$proto]['canping'] = $vli->$getIpCanping(); - $custs[ $c->getId() ]['vints'][ $vli->getId() ][$proto]['monrc'] = $vli->$getIpMonBGP(); - $custs[ $c->getId() ]['vints'][ $vli->getId() ][$proto]['vlan'] = $vli->getVlan()->getName(); - $custs[ $c->getId() ]['vints'][ $vli->getId() ][$proto]['vlanid'] = $vli->getVlan()->getId(); - $custs[ $c->getId() ]['vints'][ $vli->getId() ][$proto]['busyhost'] = $vli->getBusyhost(); - $custs[ $c->getId() ]['vints'][ $vli->getId() ][$proto]['proto'] = $proto; - - $pi = $vi->getPhysicalInterfaces()[0]; - $sw = $pi->getSwitchPort()->getSwitcher(); - - if( !isset( $switches[ $sw->getName() ] ) || !in_array( $hn, $switches[ $sw->getName() ] ) ) - $switches[ $sw->getName() ][] = $hn; - - if( !isset( $cabinets[ $sw->getCabinet()->getName() ] ) || !in_array( $hn, $cabinets[ $sw->getCabinet()->getName() ] ) ) - $cabinets[ $sw->getCabinet()->getName() ][] = $hn; - - if( !isset( $locations[ $sw->getCabinet()->getLocation()->getShortname() ] ) || !in_array( $hn, $locations[ $sw->getCabinet()->getLocation()->getShortname() ] ) ) - $locations[ $sw->getCabinet()->getLocation()->getShortname() ][] = $hn; - - if( $proto == 'v4' ) - $ipv4hosts[] = $hn; - else - $ipv6hosts[] = $hn; - - if( !isset( $custs[ $c->getId() ]['vints'][ $vli->getId() ]['phys'] ) ) - { - $custs[ $c->getId() ]['vints'][ $vli->getId() ]['phys']['switch'] = $sw->getName(); - $custs[ $c->getId() ]['vints'][ $vli->getId() ]['phys']['port'] = $pi->getSwitchPort()->getName(); - $custs[ $c->getId() ]['vints'][ $vli->getId() ]['phys']['lag'] = count( $vi->getPhysicalInterfaces() ) - 1; - } - } - - } - } - } - } - - $this->view->custs = $custs; - $this->view->switches = $switches; - $this->view->cabinets = $cabinets; - $this->view->locations = $locations; - $this->view->ipv4hosts = $ipv4hosts; - $this->view->ipv6hosts = $ipv6hosts; - } - -} diff --git a/application/views/_skins/inex/nagios-cli/conf/members-host.cfg b/application/views/_skins/inex/nagios-cli/conf/members-host.cfg deleted file mode 100644 index ecdb2952f..000000000 --- a/application/views/_skins/inex/nagios-cli/conf/members-host.cfg +++ /dev/null @@ -1,18 +0,0 @@ - - -### Host: {$c.name} - {$protos.phys.switch} {$protos.phys.port} {$p.vlan} -define host { - use generic-host - host_name {$p.hostname} - alias {$c.name} - {$protos.phys.switch} {$protos.phys.port} {$p.vlan} - address {$p.address} - check_command check-host-alive - max_check_attempts 10 - notification_interval 120 - notification_period 24x7 - notification_options d,u,r - contact_groups admins -{if $c.shortname neq "as112"} - parents {$protos.phys.switch} -{/if} -} diff --git a/application/views/_skins/inex/nagios-cli/conf/members-hostgroup-all.cfg b/application/views/_skins/inex/nagios-cli/conf/members-hostgroup-all.cfg deleted file mode 100644 index a21160fcf..000000000 --- a/application/views/_skins/inex/nagios-cli/conf/members-hostgroup-all.cfg +++ /dev/null @@ -1,18 +0,0 @@ - - -############################################################################################### -############################################################################################### -############################################################################################### - -############################################################################################### -### -### All hosts -### - -define hostgroup { - hostgroup_name all-members - alias All Members - members {if count( $ipv4hosts )}{implode( $ipv4hosts, ',' )}{/if}{if count( $ipv4hosts ) and count( $ipv6hosts )},{/if}{if count( $ipv6hosts )}{implode( $ipv6hosts, ',' )}{/if} - -} - diff --git a/application/views/_skins/inex/nagios-cli/conf/members-hostgroup-cabinets.cfg b/application/views/_skins/inex/nagios-cli/conf/members-hostgroup-cabinets.cfg deleted file mode 100644 index 0726e8e60..000000000 --- a/application/views/_skins/inex/nagios-cli/conf/members-hostgroup-cabinets.cfg +++ /dev/null @@ -1,19 +0,0 @@ - - -############################################################################################### -############################################################################################### -############################################################################################### - -############################################################################################### -### -### Cabinets hostgroups -### - -{foreach $cabinets as $cname => $members} -define hostgroup { - hostgroup_name cabinet-members-{$cname} - alias Members connected in cabinet {$cname} - members {implode( $members, ',' )} -} - -{/foreach} diff --git a/application/views/_skins/inex/nagios-cli/conf/members-hostgroup-customer.cfg b/application/views/_skins/inex/nagios-cli/conf/members-hostgroup-customer.cfg deleted file mode 100644 index 2f346db8e..000000000 --- a/application/views/_skins/inex/nagios-cli/conf/members-hostgroup-customer.cfg +++ /dev/null @@ -1,9 +0,0 @@ - - -{if count( $c.hostnames )} -define hostgroup { - hostgroup_name {$c.shortname}-routers - alias {$c.name} Routers - members {implode( $c.hostnames, ',' )} -} -{/if} diff --git a/application/views/_skins/inex/nagios-cli/conf/members-hostgroup-locations.cfg b/application/views/_skins/inex/nagios-cli/conf/members-hostgroup-locations.cfg deleted file mode 100644 index 20f171e22..000000000 --- a/application/views/_skins/inex/nagios-cli/conf/members-hostgroup-locations.cfg +++ /dev/null @@ -1,19 +0,0 @@ - - -############################################################################################### -############################################################################################### -############################################################################################### - -############################################################################################### -### -### Location hostgroups -### - -{foreach $locations as $lname => $members} -define hostgroup { - hostgroup_name location-members-{$lname} - alias Members connected in location {$lname} - members {implode( $members, ',' )} -} - -{/foreach} diff --git a/application/views/_skins/inex/nagios-cli/conf/members-hostgroup-protocols.cfg b/application/views/_skins/inex/nagios-cli/conf/members-hostgroup-protocols.cfg deleted file mode 100644 index 72a77f1a5..000000000 --- a/application/views/_skins/inex/nagios-cli/conf/members-hostgroup-protocols.cfg +++ /dev/null @@ -1,26 +0,0 @@ - - -############################################################################################### -############################################################################################### -############################################################################################### - -############################################################################################### -### -### Protocol hostgroups -### - -{if count( $ipv4hosts )} -define hostgroup { - hostgroup_name ipv4-members - alias Members connected via IPv4 - members {implode( $ipv4hosts, ',' )} -} -{/if} - -{if count( $ipv6hosts )} -define hostgroup { - hostgroup_name ipv6-members - alias Members connected via IPv6 - members {implode( $ipv6hosts, ',' )} -} -{/if} diff --git a/application/views/_skins/inex/nagios-cli/conf/members-hostgroup-switches.cfg b/application/views/_skins/inex/nagios-cli/conf/members-hostgroup-switches.cfg deleted file mode 100644 index 292f789fd..000000000 --- a/application/views/_skins/inex/nagios-cli/conf/members-hostgroup-switches.cfg +++ /dev/null @@ -1,19 +0,0 @@ - - -############################################################################################### -############################################################################################### -############################################################################################### - -############################################################################################### -### -### Switch hostgroups -### - -{foreach $switches as $sname => $members} -define hostgroup { - hostgroup_name switch-members-{$sname} - alias Members on switch {$sname} - members {implode( $members, ',' )} -} - -{/foreach} diff --git a/application/views/_skins/inex/nagios-cli/conf/members-service-ping.cfg b/application/views/_skins/inex/nagios-cli/conf/members-service-ping.cfg deleted file mode 100644 index ba2f3d231..000000000 --- a/application/views/_skins/inex/nagios-cli/conf/members-service-ping.cfg +++ /dev/null @@ -1,19 +0,0 @@ - - -### Service: {$c.name} - {$protos.phys.switch} {$protos.phys.port} {$p.vlan} -define service { - use generic-service - host_name {$p.hostname} - check_period 24x7 - max_check_attempts 3 - normal_check_interval 5 - retry_check_interval 1 - contact_groups admins - notification_interval 120 - notification_period 24x7 - notification_options w,u,c,r - service_description PING{if $p.busyhost}-busy{/if} - - check_command check_ping!{if $p.busyhost}1000.0,80%!2000.0,90%{else}100.0,20%!500.0,60%{/if} - -} diff --git a/application/views/_skins/inex/nagios-cli/conf/members-service-rcmon.cfg b/application/views/_skins/inex/nagios-cli/conf/members-service-rcmon.cfg deleted file mode 100644 index 8409c684e..000000000 --- a/application/views/_skins/inex/nagios-cli/conf/members-service-rcmon.cfg +++ /dev/null @@ -1,19 +0,0 @@ - - -{if $p.monrc and $p.vlanid eq 2 and isset( $options.router.collector.conf.snmppasswd ) and $p.proto eq 'v4'} -### BGP: {$c.name} - {$protos.phys.switch} {$protos.phys.port} {$p.vlan} -define service { - use generic-service - host_name {$p.hostname} - service_description BGP / Route Collector - check_period 24x7 - max_check_attempts 3 - normal_check_interval 5 - retry_check_interval 1 - contact_groups admins - notification_interval 120 - notification_period 24x7 - notification_options w,u,c,r - check_command check_bgp_route_collector!{$options.router.collector.conf.snmppasswd} -} -{/if} diff --git a/application/views/_skins/inex/nagios-cli/conf/members.cfg b/application/views/_skins/inex/nagios-cli/conf/members.cfg deleted file mode 100644 index 7f0328288..000000000 --- a/application/views/_skins/inex/nagios-cli/conf/members.cfg +++ /dev/null @@ -1,28 +0,0 @@ - -{foreach $custs as $c} - - -############################################################################################### -### -### {$c.name} ({$c.shortname}) -### - - {foreach $c.vints as $cliid => $protos} - {foreach $protos as $proto => $p} - {if $proto eq 'phys'}{continue}{/if} - {if $p.canping} - {tmplinclude file='nagios-cli/conf/members-host.cfg'} - {tmplinclude file='nagios-cli/conf/members-service-ping.cfg'} - {tmplinclude file='nagios-cli/conf/members-service-rcmon.cfg'} - {/if} - {/foreach} - {/foreach} - {tmplinclude file='nagios-cli/conf/members-hostgroup-customer.cfg'} - -{/foreach} - -{tmplinclude file='nagios-cli/conf/members-hostgroup-switches.cfg'} -{tmplinclude file='nagios-cli/conf/members-hostgroup-cabinets.cfg'} -{tmplinclude file='nagios-cli/conf/members-hostgroup-locations.cfg'} -{tmplinclude file='nagios-cli/conf/members-hostgroup-protocols.cfg'} -{tmplinclude file='nagios-cli/conf/members-hostgroup-all.cfg'} diff --git a/application/views/_skins/inex/nagios-cli/conf/switch-definitions.phtml b/application/views/_skins/inex/nagios-cli/conf/switch-definitions.phtml deleted file mode 100644 index 7eb42fe14..000000000 --- a/application/views/_skins/inex/nagios-cli/conf/switch-definitions.phtml +++ /dev/null @@ -1,81 +0,0 @@ -# -# This file contains static definitions for use with the IXP Manager -# Nagios configuration templates and is following by dynamic host -# configurations. -# -# Please see: https://github.com/inex/IXP-Manager/wiki/Nagios -# -# You should not need to edit these files - instead use your own custom skins. If -# you can't effect the changes you need with skinning, consider posting to the mailing -# list to see if it can be achieved / incorporated. -# -# Skinning: https://github.com/inex/IXP-Manager/wiki/Skinning -# - -define host{ - name ixp-production-switch - notifications_enabled 1 ; Host notifications are enabled - event_handler_enabled 0 ; Host event handler is enabled - flap_detection_enabled 1 ; Flap detection is enabled - process_perf_data 1 ; Process performance data - retain_status_information 1 ; Retain status information across program restarts - retain_nonstatus_information 1 ; Retain non-status information across program restarts - - checks_enabled 1 - check_command check-host-alive - max_check_attempts 3 ; number of not 'UP' checks to register as hard - check_interval 5 ; time between checks - retry_interval 1 ; time between checks if host is not 'UP' - - check_period 24x7 - - notification_interval 60 - notification_period 24x7 - notification_options u,d,r - - low_flap_threshold 0 - high_flap_threshold 0 - - register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE! - - contact_groups ixp-operations -} - - -define service{ - name ixp-production-switch-service ; The 'name' of this service template, referenced in other service definitions - active_checks_enabled 1 ; Active service checks are enabled - passive_checks_enabled 1 ; Passive service checks are enabled/accepted - parallelize_check 1 ; Active service checks should be parallelized (disabling this can lead to major performance problems) - obsess_over_service 1 ; We should obsess over this service (if necessary) - check_freshness 0 ; Default is to NOT check service 'freshness' - notifications_enabled 1 ; Service notifications are enabled - event_handler_enabled 0 ; Service event handler is enabled - flap_detection_enabled 1 ; Flap detection is enabled - process_perf_data 1 ; Process performance data - retain_status_information 1 ; Retain status information across program restarts - retain_nonstatus_information 1 ; Retain non-status information across program restarts - contact_groups ixp-operations - - max_check_attempts 3 - normal_check_interval 5 - retry_check_interval 1 - check_period 24x7 - - notification_interval 60 - notification_period 24x7 - notification_options w,u,c,r - - low_flap_threshold 0 - high_flap_threshold 0 - - is_volatile 0 - - register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE! -} - - -# -# Dynamically generated configurations follow: -# - diff --git a/application/views/_skins/inex/nagios-cli/conf/switch-hosts.phtml b/application/views/_skins/inex/nagios-cli/conf/switch-hosts.phtml deleted file mode 100644 index ddbf376ca..000000000 --- a/application/views/_skins/inex/nagios-cli/conf/switch-hosts.phtml +++ /dev/null @@ -1,12 +0,0 @@ -# -# {$sw->getName()} - {$sw->getCabinet()->getCololocation()}, {$sw->getCabinet()->getLocation()->getName()} -# - -define host { - use ixp-production-switch - host_name {$sw->getName()} - alias {$sw->getName()} - address {$sw->getIpv4addr()} -} - - diff --git a/application/views/_skins/inex/nagios-cli/conf/switch-templates.phtml b/application/views/_skins/inex/nagios-cli/conf/switch-templates.phtml deleted file mode 100644 index 234c02d63..000000000 --- a/application/views/_skins/inex/nagios-cli/conf/switch-templates.phtml +++ /dev/null @@ -1,67 +0,0 @@ - -{foreach $locations as $name => $switches} - -define hostgroup { - hostgroup_name IXP-Switches-{$name} - alias IXP Switches at {$name} - members {$switches} -} - -{/foreach} - - -define hostgroup { - hostgroup_name IXP-Production-Switches - alias IXP Production Switches (all) - members {$all} -} - -{foreach $vendors as $shortname => $v} -define hostgroup { - hostgroup_name IXP-Switches-{$shortname} - alias IXP {$shortname} Switches - members {$vendor_strings.$shortname} -} - -{/foreach} - - -{foreach $vendors as $shortname => $v} - -{* currently don't have a MRV chassis check @ INEX *} -{if $shortname neq 'MRV'} -define service{ - use ixp-production-switch-service - hostgroup_name IXP-Switches-{$shortname} - service_description Chassis - check_command check_{$v[0]->getVendor()->getNagiosName()}_chassis!{$v[0]->getSnmppasswd()} -} -{/if} - -{if $shortname eq 'Cisco'} -define service { - use ixp-production-switch-service - service_description Temperature - hostgroup_name IXP-Switches-{$shortname} - check_command check_{$v[0]->getVendor()->getNagiosName()}_temperature!{$v[0]->getSnmppasswd()}!32!38 -} -{/if} - -{/foreach} - - -define service{ - use ixp-production-switch-service - hostgroup_name IXP-Production-Switches - service_description ping - IPv4 - check_command check_ping_ipv4!10!100.0,10%!200.0,20% -} - -# Brocade IronWare has dropbox ssh bug -#define service { -# use ixp-production-switch-service -# service_description SSH -# hostgroup_name IXP-Production-Switches -# check_command check_ssh -#} - diff --git a/application/views/nagios-cli/conf/members-host.cfg b/application/views/nagios-cli/conf/members-host.cfg deleted file mode 100644 index 569f299a4..000000000 --- a/application/views/nagios-cli/conf/members-host.cfg +++ /dev/null @@ -1,16 +0,0 @@ - - -### Host: {$c.name} - {$protos.phys.switch} {$protos.phys.port} {$p.vlan} -define host { - use generic-host - host_name {$p.hostname} - alias {$c.name} - {$protos.phys.switch} {$protos.phys.port} {$p.vlan} - address {$p.address} - check_command check-host-alive - max_check_attempts 10 - notification_interval 120 - notification_period 24x7 - notification_options d,u,r - contact_groups admins - parents {$protos.phys.switch} -} diff --git a/application/views/nagios-cli/conf/members-hostgroup-all.cfg b/application/views/nagios-cli/conf/members-hostgroup-all.cfg deleted file mode 100644 index a21160fcf..000000000 --- a/application/views/nagios-cli/conf/members-hostgroup-all.cfg +++ /dev/null @@ -1,18 +0,0 @@ - - -############################################################################################### -############################################################################################### -############################################################################################### - -############################################################################################### -### -### All hosts -### - -define hostgroup { - hostgroup_name all-members - alias All Members - members {if count( $ipv4hosts )}{implode( $ipv4hosts, ',' )}{/if}{if count( $ipv4hosts ) and count( $ipv6hosts )},{/if}{if count( $ipv6hosts )}{implode( $ipv6hosts, ',' )}{/if} - -} - diff --git a/application/views/nagios-cli/conf/members-hostgroup-cabinets.cfg b/application/views/nagios-cli/conf/members-hostgroup-cabinets.cfg deleted file mode 100644 index 0726e8e60..000000000 --- a/application/views/nagios-cli/conf/members-hostgroup-cabinets.cfg +++ /dev/null @@ -1,19 +0,0 @@ - - -############################################################################################### -############################################################################################### -############################################################################################### - -############################################################################################### -### -### Cabinets hostgroups -### - -{foreach $cabinets as $cname => $members} -define hostgroup { - hostgroup_name cabinet-members-{$cname} - alias Members connected in cabinet {$cname} - members {implode( $members, ',' )} -} - -{/foreach} diff --git a/application/views/nagios-cli/conf/members-hostgroup-customer.cfg b/application/views/nagios-cli/conf/members-hostgroup-customer.cfg deleted file mode 100644 index 2f346db8e..000000000 --- a/application/views/nagios-cli/conf/members-hostgroup-customer.cfg +++ /dev/null @@ -1,9 +0,0 @@ - - -{if count( $c.hostnames )} -define hostgroup { - hostgroup_name {$c.shortname}-routers - alias {$c.name} Routers - members {implode( $c.hostnames, ',' )} -} -{/if} diff --git a/application/views/nagios-cli/conf/members-hostgroup-locations.cfg b/application/views/nagios-cli/conf/members-hostgroup-locations.cfg deleted file mode 100644 index 20f171e22..000000000 --- a/application/views/nagios-cli/conf/members-hostgroup-locations.cfg +++ /dev/null @@ -1,19 +0,0 @@ - - -############################################################################################### -############################################################################################### -############################################################################################### - -############################################################################################### -### -### Location hostgroups -### - -{foreach $locations as $lname => $members} -define hostgroup { - hostgroup_name location-members-{$lname} - alias Members connected in location {$lname} - members {implode( $members, ',' )} -} - -{/foreach} diff --git a/application/views/nagios-cli/conf/members-hostgroup-protocols.cfg b/application/views/nagios-cli/conf/members-hostgroup-protocols.cfg deleted file mode 100644 index 72a77f1a5..000000000 --- a/application/views/nagios-cli/conf/members-hostgroup-protocols.cfg +++ /dev/null @@ -1,26 +0,0 @@ - - -############################################################################################### -############################################################################################### -############################################################################################### - -############################################################################################### -### -### Protocol hostgroups -### - -{if count( $ipv4hosts )} -define hostgroup { - hostgroup_name ipv4-members - alias Members connected via IPv4 - members {implode( $ipv4hosts, ',' )} -} -{/if} - -{if count( $ipv6hosts )} -define hostgroup { - hostgroup_name ipv6-members - alias Members connected via IPv6 - members {implode( $ipv6hosts, ',' )} -} -{/if} diff --git a/application/views/nagios-cli/conf/members-hostgroup-switches.cfg b/application/views/nagios-cli/conf/members-hostgroup-switches.cfg deleted file mode 100644 index 292f789fd..000000000 --- a/application/views/nagios-cli/conf/members-hostgroup-switches.cfg +++ /dev/null @@ -1,19 +0,0 @@ - - -############################################################################################### -############################################################################################### -############################################################################################### - -############################################################################################### -### -### Switch hostgroups -### - -{foreach $switches as $sname => $members} -define hostgroup { - hostgroup_name switch-members-{$sname} - alias Members on switch {$sname} - members {implode( $members, ',' )} -} - -{/foreach} diff --git a/application/views/nagios-cli/conf/members-service-ping.cfg b/application/views/nagios-cli/conf/members-service-ping.cfg deleted file mode 100644 index ba2f3d231..000000000 --- a/application/views/nagios-cli/conf/members-service-ping.cfg +++ /dev/null @@ -1,19 +0,0 @@ - - -### Service: {$c.name} - {$protos.phys.switch} {$protos.phys.port} {$p.vlan} -define service { - use generic-service - host_name {$p.hostname} - check_period 24x7 - max_check_attempts 3 - normal_check_interval 5 - retry_check_interval 1 - contact_groups admins - notification_interval 120 - notification_period 24x7 - notification_options w,u,c,r - service_description PING{if $p.busyhost}-busy{/if} - - check_command check_ping!{if $p.busyhost}1000.0,80%!2000.0,90%{else}100.0,20%!500.0,60%{/if} - -} diff --git a/application/views/nagios-cli/conf/members-service-rcmon.cfg b/application/views/nagios-cli/conf/members-service-rcmon.cfg deleted file mode 100644 index 932f898d7..000000000 --- a/application/views/nagios-cli/conf/members-service-rcmon.cfg +++ /dev/null @@ -1,19 +0,0 @@ - - -{if $p.monrc and isset( $options.router.collector.conf.snmppasswd )} -### BGP: {$c.name} - {$protos.phys.switch} {$protos.phys.port} {$p.vlan} -define service { - use generic-service - host_name {$p.hostname} - service_description BGP / Route Collector - check_period 24x7 - max_check_attempts 3 - normal_check_interval 5 - retry_check_interval 1 - contact_groups admins - notification_interval 120 - notification_period 24x7 - notification_options w,u,c,r - check_command check_bgp_route_collector!{$options.router.collector.conf.snmppasswd} -} -{/if} diff --git a/application/views/nagios-cli/conf/members.cfg b/application/views/nagios-cli/conf/members.cfg deleted file mode 100644 index 915e4077e..000000000 --- a/application/views/nagios-cli/conf/members.cfg +++ /dev/null @@ -1,27 +0,0 @@ - -{foreach $custs as $c} - -############################################################################################### -### -### {$c.name} ({$c.shortname}) -### - - {foreach $c.vints as $cliid => $protos} - {foreach $protos as $proto => $p} - {if $proto eq 'phys'}{continue}{/if} - {if $p.canping} - {tmplinclude file='nagios-cli/conf/members-host.cfg'} - {tmplinclude file='nagios-cli/conf/members-service-ping.cfg'} - {tmplinclude file='nagios-cli/conf/members-service-rcmon.cfg'} - {/if} - {/foreach} - {/foreach} - {tmplinclude file='nagios-cli/conf/members-hostgroup-customer.cfg'} - -{/foreach} - -{tmplinclude file='nagios-cli/conf/members-hostgroup-switches.cfg'} -{tmplinclude file='nagios-cli/conf/members-hostgroup-cabinets.cfg'} -{tmplinclude file='nagios-cli/conf/members-hostgroup-locations.cfg'} -{tmplinclude file='nagios-cli/conf/members-hostgroup-protocols.cfg'} -{tmplinclude file='nagios-cli/conf/members-hostgroup-all.cfg'} diff --git a/application/views/nagios-cli/conf/switch-definitions.phtml b/application/views/nagios-cli/conf/switch-definitions.phtml deleted file mode 100644 index 7eb42fe14..000000000 --- a/application/views/nagios-cli/conf/switch-definitions.phtml +++ /dev/null @@ -1,81 +0,0 @@ -# -# This file contains static definitions for use with the IXP Manager -# Nagios configuration templates and is following by dynamic host -# configurations. -# -# Please see: https://github.com/inex/IXP-Manager/wiki/Nagios -# -# You should not need to edit these files - instead use your own custom skins. If -# you can't effect the changes you need with skinning, consider posting to the mailing -# list to see if it can be achieved / incorporated. -# -# Skinning: https://github.com/inex/IXP-Manager/wiki/Skinning -# - -define host{ - name ixp-production-switch - notifications_enabled 1 ; Host notifications are enabled - event_handler_enabled 0 ; Host event handler is enabled - flap_detection_enabled 1 ; Flap detection is enabled - process_perf_data 1 ; Process performance data - retain_status_information 1 ; Retain status information across program restarts - retain_nonstatus_information 1 ; Retain non-status information across program restarts - - checks_enabled 1 - check_command check-host-alive - max_check_attempts 3 ; number of not 'UP' checks to register as hard - check_interval 5 ; time between checks - retry_interval 1 ; time between checks if host is not 'UP' - - check_period 24x7 - - notification_interval 60 - notification_period 24x7 - notification_options u,d,r - - low_flap_threshold 0 - high_flap_threshold 0 - - register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE! - - contact_groups ixp-operations -} - - -define service{ - name ixp-production-switch-service ; The 'name' of this service template, referenced in other service definitions - active_checks_enabled 1 ; Active service checks are enabled - passive_checks_enabled 1 ; Passive service checks are enabled/accepted - parallelize_check 1 ; Active service checks should be parallelized (disabling this can lead to major performance problems) - obsess_over_service 1 ; We should obsess over this service (if necessary) - check_freshness 0 ; Default is to NOT check service 'freshness' - notifications_enabled 1 ; Service notifications are enabled - event_handler_enabled 0 ; Service event handler is enabled - flap_detection_enabled 1 ; Flap detection is enabled - process_perf_data 1 ; Process performance data - retain_status_information 1 ; Retain status information across program restarts - retain_nonstatus_information 1 ; Retain non-status information across program restarts - contact_groups ixp-operations - - max_check_attempts 3 - normal_check_interval 5 - retry_check_interval 1 - check_period 24x7 - - notification_interval 60 - notification_period 24x7 - notification_options w,u,c,r - - low_flap_threshold 0 - high_flap_threshold 0 - - is_volatile 0 - - register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE! -} - - -# -# Dynamically generated configurations follow: -# - diff --git a/application/views/nagios-cli/conf/switch-hosts.phtml b/application/views/nagios-cli/conf/switch-hosts.phtml deleted file mode 100644 index ddbf376ca..000000000 --- a/application/views/nagios-cli/conf/switch-hosts.phtml +++ /dev/null @@ -1,12 +0,0 @@ -# -# {$sw->getName()} - {$sw->getCabinet()->getCololocation()}, {$sw->getCabinet()->getLocation()->getName()} -# - -define host { - use ixp-production-switch - host_name {$sw->getName()} - alias {$sw->getName()} - address {$sw->getIpv4addr()} -} - - diff --git a/application/views/nagios-cli/conf/switch-templates.phtml b/application/views/nagios-cli/conf/switch-templates.phtml deleted file mode 100644 index 6f63ed80d..000000000 --- a/application/views/nagios-cli/conf/switch-templates.phtml +++ /dev/null @@ -1,65 +0,0 @@ - -{foreach $locations as $name => $switches} - -define hostgroup { - hostgroup_name IXP-Switches-{$name} - alias IXP Switches at {$name} - members {$switches} - -} - -{/foreach} - - -define hostgroup { - hostgroup_name IXP-Production-Switches - alias IXP Production Switches (all) - members {$all} - -} - -{foreach $vendors as $shortname => $v} -define hostgroup { - hostgroup_name IXP-Switches-{$shortname} - alias IXP {$shortname} Switches - members {$vendor_strings.$shortname} - -} - -{/foreach} - - -{foreach $vendors as $shortname => $v} -define service{ - use ixp-production-switch-service - hostgroup_name IXP-Switches-{$shortname} - service_description Chassis - check_command check_{$v[0]->getVendor()->getNagiosName()}_chassis!{$v[0]->getSnmppasswd()} -} - -{if $shortname eq 'Cisco'} -define service { - use ixp-production-switch-service - service_description Temperature - hostgroup_name IXP-Switches-{$shortname} - check_command check_{$v[0]->getVendor()->getNagiosName()}_temperature!{$v[0]->getSnmppasswd()}!32!38 -} -{/if} - -{/foreach} - - -define service{ - use ixp-production-switch-service - hostgroup_name IXP-Production-Switches - service_description ping - IPv4 - check_command check_ping_ipv4!10!100.0,10%!200.0,20% -} - -define service { - use ixp-production-switch-service - service_description SSH - hostgroup_name IXP-Production-Switches - check_command check_ssh -} -