From 070e685350304014473381d492edad36f584797e Mon Sep 17 00:00:00 2001 From: Daniel Poelzleithner Date: Thu, 15 Aug 2019 23:39:45 +0200 Subject: [PATCH] enable logging on switches --- salt/switches/3com-4200G.expect | 9 +++++++++ salt/switches/HP-procurve-2824.expect | 10 ++++++++++ salt/switches/TL-SG3210.expect | 3 +++ 3 files changed, 22 insertions(+) diff --git a/salt/switches/3com-4200G.expect b/salt/switches/3com-4200G.expect index 8c4812b..504944a 100644 --- a/salt/switches/3com-4200G.expect +++ b/salt/switches/3com-4200G.expect @@ -30,6 +30,15 @@ expect -- "-luser-admin]" send "quit\r" expect "{{ hostname }}]" +{# Enable logging #} +send "info-center enable\r" +expect "]" +send "info-center loghost {{logging}} channel loghost facility local6\r" +expect "]" +send "info-center source default channel loghost log level informational\r" +expect "]" + + {%- for name, vlan in pillar['vlans'].items() %} send "vlan {{ vlan }}\r" expect -- "-vlan{{ vlan }}]" diff --git a/salt/switches/HP-procurve-2824.expect b/salt/switches/HP-procurve-2824.expect index 660f129..da0c3ba 100644 --- a/salt/switches/HP-procurve-2824.expect +++ b/salt/switches/HP-procurve-2824.expect @@ -26,6 +26,16 @@ expect "(config)# " # TODO: ssh, password +{# Enable Logging #} +send "logging {{logging}}\r" +expect "(config)# " +send "logging facility local6\r" +expect "(config)# " + +# todo ntp +# timesync sntp +# ip timep manual {{ntp}} interval 10 + {%- for name, vlan in pillar['vlans'].items() %} send "vlan {{ vlan }}\r" expect "(vlan-{{ vlan }})#" diff --git a/salt/switches/TL-SG3210.expect b/salt/switches/TL-SG3210.expect index cf97f64..b47d547 100644 --- a/salt/switches/TL-SG3210.expect +++ b/salt/switches/TL-SG3210.expect @@ -31,6 +31,9 @@ expect "(config)#" send "location \"{{ switch['location'] }}\"\r" expect "(config)#" +send "logging host index 1 {{logging}} 6\r" +expect "(config)#" + {%- set mgmt_vlan = pillar['vlans']['mgmt'] %} send "ip management-vlan {{ mgmt_vlan }}\r" expect "(config)#"