maintenance:general:syslog-ng_install
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
maintenance:general:syslog-ng_install [2020/07/01 12:36] – [option-1: YUM install] bdorlandt | maintenance:general:syslog-ng_install [2024/07/03 12:31] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ======= Syslog-ng install ======= | ||
+ | |||
+ | NetYCE uses the public domain **Syslog-NG** package to provide SYSLOG services. The RedHat and CentOS distribution comes with the default **rsyslogd** that cannot provide the required services for the NCCM and Compliance functions. | ||
+ | |||
+ | Syslog-NG is needed for remote syslog signalling and to receive Syslog events from devices. This article describes the installation of Syslog-NG for RedHat/ | ||
+ | |||
+ | |||
+ | ====== RHEL 6 (CentOS 6) ====== | ||
+ | |||
+ | The required packages are not available by default through '' | ||
+ | |||
+ | ===== option-1: YUM install ===== | ||
+ | |||
+ | First install EPEL repo: | ||
+ | < | ||
+ | sudo yum --enablerepo=extras install epel-release | ||
+ | </ | ||
+ | |||
+ | This installs the package: | ||
+ | < | ||
+ | |||
+ | Then install syslog-ng and its dbi: | ||
+ | < | ||
+ | sudo yum install syslog-ng syslog-ng-libdbi | ||
+ | </ | ||
+ | |||
+ | Sample session: | ||
+ | < | ||
+ | Dependencies Resolved | ||
+ | |||
+ | ================================================================================ | ||
+ | | ||
+ | ================================================================================ | ||
+ | Installing: | ||
+ | | ||
+ | | ||
+ | Installing for dependencies: | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | This installs the packages: | ||
+ | < | ||
+ | eventlog-0.2.13-1.el6.x86_64.rpm | ||
+ | libdbi-0.8.3-4.el6.x86_64.rpm | ||
+ | libnet-1.1.6-7.el6.x86_64.rpm | ||
+ | syslog-ng-3.2.5-4.el6.x86_64.rpm | ||
+ | syslog-ng-libdbi-3.2.5-4.el6.x86_64.rpm | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== option-2: Manual install ===== | ||
+ | |||
+ | <color orange> | ||
+ | |||
+ | Download the " | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | |||
+ | |||
+ | After downloading, | ||
+ | |||
+ | Install the packages: | ||
+ | < | ||
+ | |||
+ | cd / | ||
+ | |||
+ | (in case you downloaded the .tgz file unpack this with 'cd / | ||
+ | |||
+ | sudo rpm -Uvh *.rpm | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Remove rsyslog ===== | ||
+ | |||
+ | The RHEL6 systems come preinstalled with '' | ||
+ | |||
+ | < | ||
+ | sudo yum erase rsyslog | ||
+ | </ | ||
+ | |||
+ | This removes the package: | ||
+ | < | ||
+ | |||
+ | |||
+ | ===== Configuration ===== | ||
+ | |||
+ | |||
+ | ==== Syslog-ng config ==== | ||
+ | |||
+ | < | ||
+ | sudo vim / | ||
+ | </ | ||
+ | |||
+ | The Syslog-ng configuration file needs some modifications. It is best replaced with the file below if there are no customer specific changes. This config adds the ' | ||
+ | |||
+ | It is this log-file that will be monitored by the '' | ||
+ | |||
+ | <file perl syslog-ng.conf> | ||
+ | @version: | ||
+ | |||
+ | # syslog-ng configuration file for NetYCE. | ||
+ | # | ||
+ | # This should behave pretty much like the original syslog on RedHat. | ||
+ | # See syslog-ng(8) and syslog-ng.conf(5) for more information. | ||
+ | # | ||
+ | |||
+ | options { | ||
+ | flush_lines (0); | ||
+ | time_reopen (10); | ||
+ | log_fifo_size (1000); | ||
+ | chain_hostnames (off); | ||
+ | use_dns (yes); | ||
+ | use_fqdn (yes); | ||
+ | create_dirs (no); | ||
+ | keep_hostname (yes); | ||
+ | keep-timestamp (no); | ||
+ | }; | ||
+ | |||
+ | source net { | ||
+ | tcp(); | ||
+ | udp(); | ||
+ | }; | ||
+ | |||
+ | source s_sys { | ||
+ | file ("/ | ||
+ | unix-stream ("/ | ||
+ | internal(); | ||
+ | # udp(ip(0.0.0.0) port(514)); | ||
+ | }; | ||
+ | |||
+ | destination d_logs { | ||
+ | file( | ||
+ | "/ | ||
+ | owner(" | ||
+ | group(" | ||
+ | perm(0644) | ||
+ | ); | ||
+ | }; | ||
+ | destination d_cons { file("/ | ||
+ | destination d_mesg { file("/ | ||
+ | destination d_auth { file("/ | ||
+ | destination d_mail { file("/ | ||
+ | destination d_spol { file("/ | ||
+ | destination d_boot { file("/ | ||
+ | destination d_cron { file("/ | ||
+ | destination d_kern { file("/ | ||
+ | destination d_mlal { usertty(" | ||
+ | |||
+ | filter f_kernel | ||
+ | filter f_default | ||
+ | level(info..emerg) and | ||
+ | not (facility(mail) | ||
+ | or facility(authpriv) | ||
+ | or facility(cron)); | ||
+ | }; | ||
+ | filter f_auth | ||
+ | filter f_mail | ||
+ | filter f_emergency | ||
+ | filter f_news | ||
+ | facility(uucp) or | ||
+ | (facility(news) | ||
+ | and level(crit..emerg)); | ||
+ | }; | ||
+ | |||
+ | filter f_boot | ||
+ | filter f_cron | ||
+ | |||
+ | log { source(net); | ||
+ | log { source(s_sys); | ||
+ | #log { source(s_sys); | ||
+ | log { source(s_sys); | ||
+ | log { source(s_sys); | ||
+ | log { source(s_sys); | ||
+ | log { source(s_sys); | ||
+ | log { source(s_sys); | ||
+ | log { source(s_sys); | ||
+ | log { source(s_sys); | ||
+ | |||
+ | # end | ||
+ | </ | ||
+ | |||
+ | ==== Syslog-ng startup==== | ||
+ | |||
+ | Enable the syslog-ng as startup daemon and start the service | ||
+ | |||
+ | < | ||
+ | sudo chkconfig --add syslog-ng | ||
+ | sudo chkconfig --level 2345 syslog-ng on | ||
+ | sudo chkconfig --list syslog-ng | ||
+ | sudo service syslog-ng start | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ====== RHEL7 (CentOS 7) ====== | ||
+ | |||
+ | The required packages are not available by default through '' | ||
+ | |||
+ | ===== option-1: YUM install ===== | ||
+ | |||
+ | > Note: On CentOS7 **yum** did not seem to need EPEL-repo on the systems we worked with. But as this might be due to an earlier install where " | ||
+ | |||
+ | Add EPEL support for yum | ||
+ | < | ||
+ | sudo yum --enablerepo=extras install epel-release | ||
+ | </ | ||
+ | |||
+ | Then, install syslog-ng and its dbi using: | ||
+ | < | ||
+ | sudo yum install syslog-ng syslog-ng-libdbi | ||
+ | </ | ||
+ | |||
+ | Sample session: | ||
+ | < | ||
+ | yce@release7 / | ||
+ | $ sudo yum install syslog-ng syslog-ng-libdbi | ||
+ | Loaded plugins: fastestmirror | ||
+ | Loading mirror speeds from cached hostfile | ||
+ | epel/ | ||
+ | Could not retrieve mirrorlist https:// | ||
+ | 14: curl#6 - "Could not resolve host: mirrors.iuscommunity.org; | ||
+ | * base: centos.mirror.triple-it.nl | ||
+ | * epel: mirror.hostnet.nl | ||
+ | * extras: ftp.tudelft.nl | ||
+ | * updates: mirror.vimexx.nl | ||
+ | base | 3.6 kB 00:00:00 | ||
+ | extras | ||
+ | ius | 1.3 kB 00:00:00 | ||
+ | mariadb | ||
+ | mysecureshell | ||
+ | updates | ||
+ | Resolving Dependencies | ||
+ | --> Running transaction check | ||
+ | ---> Package syslog-ng.x86_64 0: | ||
+ | --> Processing Dependency: ivykis >= 0.36.1 for package: syslog-ng-3.5.6-3.el7.x86_64 | ||
+ | --> Processing Dependency: libivykis.so.0(IVYKIS_0.29)(64bit) for package: syslog-ng-3.5.6-3.el7.x86_64 | ||
+ | --> Processing Dependency: libivykis.so.0(IVYKIS_0.30)(64bit) for package: syslog-ng-3.5.6-3.el7.x86_64 | ||
+ | --> Processing Dependency: libevtlog.so.0()(64bit) for package: syslog-ng-3.5.6-3.el7.x86_64 | ||
+ | --> Processing Dependency: libivykis.so.0()(64bit) for package: syslog-ng-3.5.6-3.el7.x86_64 | ||
+ | --> Processing Dependency: libnet.so.1()(64bit) for package: syslog-ng-3.5.6-3.el7.x86_64 | ||
+ | ---> Package syslog-ng-libdbi.x86_64 0: | ||
+ | --> Processing Dependency: libdbi.so.0()(64bit) for package: syslog-ng-libdbi-3.5.6-3.el7.x86_64 | ||
+ | --> Running transaction check | ||
+ | ---> Package eventlog.x86_64 0: | ||
+ | ---> Package ivykis.x86_64 0: | ||
+ | ---> Package libdbi.x86_64 0: | ||
+ | ---> Package libnet.x86_64 0: | ||
+ | --> Finished Dependency Resolution | ||
+ | |||
+ | Dependencies Resolved | ||
+ | |||
+ | ============================================================================================================== | ||
+ | | ||
+ | ============================================================================================================== | ||
+ | Installing: | ||
+ | | ||
+ | | ||
+ | Installing for dependencies: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | Transaction Summary | ||
+ | ============================================================================================================== | ||
+ | Install | ||
+ | |||
+ | Total download size: 651 k | ||
+ | Installed size: 2.0 M | ||
+ | Is this ok [y/d/N]: | ||
+ | </ | ||
+ | |||
+ | Acknowledge and installation completes automatically. | ||
+ | |||
+ | |||
+ | ===== option-2: Manual install ===== | ||
+ | |||
+ | When no yum repository is available, a manual install is needed. The '' | ||
+ | |||
+ | ^Package name^Package version^Package rpm-file^ | ||
+ | |syslog-ng.x86_64| 0: | ||
+ | |syslog-ng-libdbi.x86_64| 0: | ||
+ | | ||| | ||
+ | |eventlog.x86_64| 0: | ||
+ | |ivykis.x86_64| 0: | ||
+ | |libdbi.x86_64| 0: | ||
+ | |libnet.x86_64| 0: | ||
+ | |||
+ | Download these packages from '' | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | Or download this .tgz file with all aforementioned rpm files: {{ : | ||
+ | |||
+ | Copy the downloaded rpm files to ''/ | ||
+ | |||
+ | Install the packages: | ||
+ | < | ||
+ | cd / | ||
+ | |||
+ | (in case you downloaded the .tgz file unpack this with cd / | ||
+ | |||
+ | sudo rpm -Uvh *.rpm | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Remove rsyslog ===== | ||
+ | |||
+ | RHEL7 comes preinstalled with '' | ||
+ | |||
+ | < | ||
+ | sudo yum erase rsyslog | ||
+ | </ | ||
+ | |||
+ | This removes the package: | ||
+ | < | ||
+ | |||
+ | |||
+ | ===== Configuration ===== | ||
+ | |||
+ | |||
+ | ==== Syslog-ng config ==== | ||
+ | |||
+ | |||
+ | < | ||
+ | sudo vim / | ||
+ | </ | ||
+ | |||
+ | The Syslog-ng configuration file needs some modifications. It is best replaced with the file below if there are no customer specific changes. This config adds the ' | ||
+ | |||
+ | It is this log-file that will be monitored by the '' | ||
+ | |||
+ | <file perl syslog-ng.conf> | ||
+ | @version: | ||
+ | @include " | ||
+ | |||
+ | # RHEL7 syslog-ng configuration file for NetYCE. | ||
+ | # | ||
+ | # This should behave pretty much like the original syslog on RedHat. | ||
+ | # See syslog-ng(8) and syslog-ng.conf(5) for more information. | ||
+ | # | ||
+ | # Note: it also sources additional configuration files (*.conf) | ||
+ | # | ||
+ | |||
+ | options { | ||
+ | flush_lines (0); | ||
+ | time_reopen (10); | ||
+ | log_fifo_size (1000); | ||
+ | chain_hostnames (off); | ||
+ | use_dns (yes); | ||
+ | use_fqdn (yes); | ||
+ | create_dirs (no); | ||
+ | keep_hostname (yes); | ||
+ | keep-timestamp (no); | ||
+ | }; | ||
+ | |||
+ | source net { | ||
+ | tcp(); | ||
+ | udp(); | ||
+ | }; | ||
+ | |||
+ | source s_sys { | ||
+ | system(); | ||
+ | internal(); | ||
+ | # udp(ip(0.0.0.0) port(514)); | ||
+ | }; | ||
+ | |||
+ | destination d_logs { | ||
+ | file( | ||
+ | "/ | ||
+ | owner(" | ||
+ | group(" | ||
+ | perm(0644) | ||
+ | ); | ||
+ | }; | ||
+ | |||
+ | destination d_cons { file("/ | ||
+ | destination d_mesg { file("/ | ||
+ | destination d_auth { file("/ | ||
+ | destination d_mail { file("/ | ||
+ | destination d_spol { file("/ | ||
+ | destination d_boot { file("/ | ||
+ | destination d_cron { file("/ | ||
+ | destination d_kern { file("/ | ||
+ | destination d_mlal { usertty(" | ||
+ | |||
+ | filter f_kernel | ||
+ | filter f_default | ||
+ | level(info..emerg) and | ||
+ | not (facility(mail) | ||
+ | or facility(authpriv) | ||
+ | or facility(cron)); | ||
+ | }; | ||
+ | filter f_auth | ||
+ | filter f_mail | ||
+ | filter f_emergency | ||
+ | filter f_news | ||
+ | facility(uucp) or | ||
+ | (facility(news) | ||
+ | and level(crit..emerg)); | ||
+ | }; | ||
+ | filter f_boot | ||
+ | filter f_cron | ||
+ | |||
+ | log { source(net); | ||
+ | log { source(s_sys); | ||
+ | #log { source(s_sys); | ||
+ | log { source(s_sys); | ||
+ | log { source(s_sys); | ||
+ | log { source(s_sys); | ||
+ | log { source(s_sys); | ||
+ | log { source(s_sys); | ||
+ | log { source(s_sys); | ||
+ | log { source(s_sys); | ||
+ | |||
+ | |||
+ | # Source additional configuration files (.conf extension only) | ||
+ | @include "/ | ||
+ | |||
+ | # vim: | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== Syslog-ng startup ==== | ||
+ | |||
+ | |||
+ | Start the syslog-ng service | ||
+ | |||
+ | < | ||
+ | systemctl start syslog-ng | ||
+ | |||
+ | ps -ef | grep syslog | ||
+ | </ | ||
+ | |||
+ | And enable to start at boot time too | ||
+ | < | ||
+ | systemctl enable syslog-ng | ||
+ | </ | ||
+ | |||
+ | |||
+ | ====== Yce_events configuration ====== | ||
+ | |||
+ | After receiving a syslog message the syslog daemon ('' | ||
+ | |||
+ | To prevent continuous NCCM updates, the setup of each pattern uses a window of 10 minutes for each unique nodename or ip-address before retrieving the updated configuration. Some vendors will issue syslog messages for each command line changing the configuration, | ||
+ | |||
+ | The yce_event daemon is also responsible for resolving nodenames from the traditionally used ip-address and performs the required deduplication of messages when multiple message sources are used. | ||
+ | |||
+ | The '' | ||
+ | |||
+ | Changes can be made to the " | ||
+ | |||
+ | As these message formats are different per syslog-receiver, | ||
+ | |||
+ | The file below reflects the current distribution configuration: | ||
+ | |||
+ | <file ini yce_events.conf> | ||
+ | # | ||
+ | # (c) NetYCE, 2019 | ||
+ | # | ||
+ | # yce_events configuration to detect configuration changes | ||
+ | # from network devices syslog messages | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # Program options | ||
+ | # | ||
+ | # | ||
+ | type=StartupOptions | ||
+ | detach=yes | ||
+ | user=yce | ||
+ | group=nms | ||
+ | pid=/ | ||
+ | input=/ | ||
+ | log=/ | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # Vendor Patterns | ||
+ | # | ||
+ | # | ||
+ | # Juniper | ||
+ | # | ||
+ | type=SingleWithSuppress | ||
+ | ptype=RegExp | ||
+ | pattern=.*\s(.*)\smgd\[\d+\]: | ||
+ | desc=config save for $1 | ||
+ | action=event config_changed_for_$1 | ||
+ | window=600 | ||
+ | # | ||
+ | # F5 BIGIP (still in development mode) | ||
+ | # | ||
+ | # Sample output for a config change: | ||
+ | # Jul 29 16:12:40 f5.netyce.org debug mcpd[4487]: Setting the master key from memory. | ||
+ | # Jul 29 16:12:40 f5.netyce.org debug mcpd[4487]: save_master_key(7) called | ||
+ | # Jul 29 16:12:40 f5.netyce.org debug mcpd[4487]: Saving the new version of Master key file. | ||
+ | # Jul 29 16:12:40 f5.netyce.org debug mcpd[4487]: Wrote the new version of Master key file. | ||
+ | # Jul 29 16:12:40 f5.netyce.org debug mcpd[4487]: Wrote the new version of Recovery key file. | ||
+ | # Jul 29 16:12:40 f5.netyce.org debug mcpd[4487]: notify_master_key: | ||
+ | # Jul 29 16:12:41 f5.netyce.org notice tmsh[10999]: | ||
+ | # | ||
+ | type=SingleWithSuppress | ||
+ | ptype=RegExp | ||
+ | pattern=[\w]{3} [\d]{1,2} [\S]{8} (\S*) notice [\w]+\[\d+\]: | ||
+ | desc=config save for $1 | ||
+ | action=event config_changed_for_$1 | ||
+ | window=600 | ||
+ | # | ||
+ | # HP_C7 normal save or save main | ||
+ | # | ||
+ | type=SingleWithSuppress | ||
+ | ptype=RegExp | ||
+ | pattern=[a-zA-Z]{3}\s{1, | ||
+ | desc=config save for $1 | ||
+ | action=event config_changed_for_$1 | ||
+ | window=600 | ||
+ | # | ||
+ | # HP_C7 normal save main force or save force | ||
+ | # | ||
+ | type=SingleWithSuppress | ||
+ | ptype=RegExp | ||
+ | pattern=[a-zA-Z]{3}\s\d{1, | ||
+ | desc=config save for $1 | ||
+ | action=event config_changed_for_$1 | ||
+ | window=600 | ||
+ | # | ||
+ | # Arista_EOS | ||
+ | # | ||
+ | type=SingleWithSuppress | ||
+ | ptype=RegExp | ||
+ | pattern=[a-zA-Z]{3}\s\d{1, | ||
+ | desc=config save for $1 | ||
+ | action=event config_changed_for_$1 | ||
+ | window=600 | ||
+ | # | ||
+ | # Cisco_Nexus | ||
+ | # | ||
+ | type=SingleWithSuppress | ||
+ | ptype=RegExp | ||
+ | pattern=[a-zA-Z]{3}\s\d{1, | ||
+ | desc=config save for $1 | ||
+ | action=event config_changed_for_$1 | ||
+ | window=600 | ||
+ | # | ||
+ | # Cisco_IOS | ||
+ | # | ||
+ | type=SingleWithSuppress | ||
+ | ptype=RegExp | ||
+ | pattern=[a-zA-Z]{3}\s+\d{1, | ||
+ | desc=config save for $1 | ||
+ | action=event config_changed_for_$1 | ||
+ | window=600 | ||
+ | # | ||
+ | # HP_C5 normal save, save main, save main force or save force | ||
+ | # | ||
+ | type=SingleWithSuppress | ||
+ | ptype=RegExp | ||
+ | pattern=[a-zA-Z]{3}\s\d{1, | ||
+ | desc=config save for $1 | ||
+ | action=event config_changed_for_$1 | ||
+ | window=600 | ||
+ | # | ||
+ | # Avaya_ERS save | ||
+ | # | ||
+ | type=SingleWithSuppress | ||
+ | ptype=RegExp | ||
+ | pattern=[a-zA-Z]{3}\s\d{1, | ||
+ | desc=config save for $1 | ||
+ | action=event config_changed_for_$1 | ||
+ | window=600 | ||
+ | # | ||
+ | # CI_6 save configuration | ||
+ | # | ||
+ | type=SingleWithSuppress | ||
+ | ptype=RegExp | ||
+ | pattern=[a-zA-Z]{3}\s\d{1, | ||
+ | desc=config save for $1 | ||
+ | action=event config_changed_for_$1 | ||
+ | window=600 | ||
+ | # | ||
+ | # | ||
+ | # External worker script | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | #desc=$0 | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # Internal worker script | ||
+ | # | ||
+ | # | ||
+ | type=SingleWithSub | ||
+ | ptype=RegExp | ||
+ | pattern=config_changed_for_(\S+) | ||
+ | sub=yce_nccm | ||
+ | arg=$1 | ||
+ | desc=$0 | ||
+ | action=write - normal save OR save main node $1 matches. | ||
+ | |||
+ | </ | ||
+ | |||
+ | Yce_events.conf version for Kiwi: | ||
+ | |||
+ | <file ini yce_events.conf> | ||
+ | # | ||
+ | # (c) NetYCE, 2020 | ||
+ | # | ||
+ | # yce_events configuration to detect configuration changes | ||
+ | # from network devices syslog messages | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # Program options | ||
+ | # | ||
+ | # | ||
+ | type=StartupOptions | ||
+ | detach=yes | ||
+ | user=yce | ||
+ | group=nms | ||
+ | pid=/ | ||
+ | input=/ | ||
+ | log=/ | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # Vendor Patterns | ||
+ | # | ||
+ | # | ||
+ | # Juniper | ||
+ | # | ||
+ | type=SingleWithSuppress | ||
+ | ptype=RegExp | ||
+ | pattern=.*\s(.*)\smgd\[\d+\]: | ||
+ | desc=config save for $1 | ||
+ | action=event config_changed_for_$1 | ||
+ | window=600 | ||
+ | # | ||
+ | # F5 BIGIP (still in development mode) | ||
+ | # | ||
+ | # Sample output for a config change: | ||
+ | # Jul 29 16:12:40 f5.netyce.org debug mcpd[4487]: Setting the master key from memory. | ||
+ | # Jul 29 16:12:40 f5.netyce.org debug mcpd[4487]: save_master_key(7) called | ||
+ | # Jul 29 16:12:40 f5.netyce.org debug mcpd[4487]: Saving the new version of Master key file. | ||
+ | # Jul 29 16:12:40 f5.netyce.org debug mcpd[4487]: Wrote the new version of Master key file. | ||
+ | # Jul 29 16:12:40 f5.netyce.org debug mcpd[4487]: Wrote the new version of Recovery key file. | ||
+ | # Jul 29 16:12:40 f5.netyce.org debug mcpd[4487]: notify_master_key: | ||
+ | # Jul 29 16:12:41 f5.netyce.org notice tmsh[10999]: | ||
+ | # | ||
+ | type=SingleWithSuppress | ||
+ | ptype=RegExp | ||
+ | pattern=[\w]{3} [\d]{1,2} [\S]{8} (\S*) notice [\w]+\[\d+\]: | ||
+ | desc=config save for $1 | ||
+ | action=event config_changed_for_$1 | ||
+ | window=600 | ||
+ | |||
+ | |||
+ | # | ||
+ | # HP_C7 normal save or save main | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | #window=600 | ||
+ | # | ||
+ | # HP_C7 normal save main force or save force | ||
+ | # | ||
+ | type=SingleWithSuppress | ||
+ | ptype=RegExp | ||
+ | pattern=[a-zA-Z]{3}\s\d{1, | ||
+ | desc=config save for $1 | ||
+ | action=event config_changed_for_$1 | ||
+ | window=600 | ||
+ | # | ||
+ | # Arista_EOS | ||
+ | # | ||
+ | type=SingleWithSuppress | ||
+ | ptype=RegExp | ||
+ | pattern=[a-zA-Z]{3}\s\d{1, | ||
+ | desc=config save for $1 | ||
+ | action=event config_changed_for_$1 | ||
+ | window=600 | ||
+ | # | ||
+ | # Cisco_Nexus | ||
+ | # | ||
+ | type=SingleWithSuppress | ||
+ | ptype=RegExp | ||
+ | pattern=[a-zA-Z]{3}\s+\d{1, | ||
+ | desc=config save for $1 | ||
+ | action=event config_changed_for_$1 | ||
+ | window=600 | ||
+ | # | ||
+ | # Cisco_IOS | ||
+ | # | ||
+ | type=SingleWithSuppress | ||
+ | ptype=RegExp | ||
+ | pattern=[a-zA-Z]{3}\s+\d{1, | ||
+ | desc=config save for $1 | ||
+ | action=event config_changed_for_$1 | ||
+ | window=600 | ||
+ | # | ||
+ | # Cisco_XR | ||
+ | # | ||
+ | type=SingleWithSuppress | ||
+ | ptype=RegExp | ||
+ | pattern=[a-zA-Z]{3}\s+\d{1, | ||
+ | desc=config save for $1 | ||
+ | action=event config_changed_for_$1 | ||
+ | window=600 | ||
+ | |||
+ | # | ||
+ | # HP_C5 normal save, save main, save main force or save force | ||
+ | # | ||
+ | type=SingleWithSuppress | ||
+ | ptype=RegExp | ||
+ | pattern=[a-zA-Z]{3}\s+\d{1, | ||
+ | desc=config save for $1 | ||
+ | action=event config_changed_for_$1 | ||
+ | window=600 | ||
+ | # | ||
+ | # HP_C5 different timestamp | ||
+ | # | ||
+ | type=SingleWithSuppress | ||
+ | ptype=RegExp | ||
+ | pattern=[a-zA-Z]{3}\s+\d{1, | ||
+ | desc=config save for $1 | ||
+ | action=event config_changed_for_$1 | ||
+ | window=600 | ||
+ | # | ||
+ | # | ||
+ | # Avaya_ERS save | ||
+ | # | ||
+ | type=SingleWithSuppress | ||
+ | ptype=RegExp | ||
+ | pattern=[a-zA-Z]{3}\s\d{1, | ||
+ | desc=config save for $1 | ||
+ | action=event config_changed_for_$1 | ||
+ | window=600 | ||
+ | # | ||
+ | # CI_6 save configuration | ||
+ | # | ||
+ | type=SingleWithSuppress | ||
+ | ptype=RegExp | ||
+ | pattern=[a-zA-Z]{3}\s\d{1, | ||
+ | desc=config save for $1 | ||
+ | action=event config_changed_for_$1 | ||
+ | window=600 | ||
+ | # | ||
+ | # | ||
+ | # External worker script | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | #desc=$0 | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # Internal worker script | ||
+ | # | ||
+ | # | ||
+ | type=SingleWithSub | ||
+ | ptype=RegExp | ||
+ | pattern=config_changed_for_(\S+) | ||
+ | sub=yce_nccm | ||
+ | arg=$1 | ||
+ | desc=$0 | ||
+ | action=write - normal save OR save main node $1 matches. | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | The NCCM matching patterns used above are verified. NetYCE collected other patterns that are supposedly usable for the same purpose but have not been verified, not are known to which vendor they belong. | ||
+ | |||
+ | These patterns are: | ||
+ | |||
+ | < | ||
+ | Startexecuting: | ||
+ | Startexecuting: | ||
+ | (?: | ||
+ | cli.*USER.*COMMAND | ||
+ | AUDIT-.*modify | ||
+ | AUDIT-user\S+.*modify | ||
+ | SYS-6-CFG_CHG | ||
+ | SMETELNETfrom | ||
+ | SYS-5-CONFIG_I | ||
+ | CSCOacs | ||
+ | AAA-5-AAA_AUTH_ADMIN_USER: | ||
+ | SYSTEM_RESET | ||
+ | Leavingconfigurationmode | ||
+ | AUDIT-user\S+.*_delete | ||
+ | ,set, | ||
+ | (?: | ||
+ | HWCM | ||
+ | (?: | ||
+ | AUDIT-.*delete | ||
+ | SYS-5-CONFIG | ||
+ | command: | ||
+ | FWSM-6-605005 | ||
+ | MANAGERMode | ||
+ | OSAPI-5-CLEAN_TASK: | ||
+ | Commandissy.* | ||
+ | Configurationchangedby | ||
+ | apache: | ||
+ | ,delete, | ||
+ | daemonsys_message: | ||
+ | (?: | ||
+ | Acceptedpasswordfor | ||
+ | ,edit | ||
+ | SYSLOG_CONFIG | ||
+ | ,commit, | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== syslog messages from different vendors ===== | ||
+ | |||
+ | ^ Vendor ^ Message ^ | ||
+ | | JunOS | Feb 19 15:23:06 < | ||
+ | | Cisco Nexus | Feb 19 15:46:57 192.168.178.21 : 2020 Feb 19 14:46:59 UTC: %VSHD-5-VSHD_SYSLOG_CONFIG_I: | ||
+ | | Cisco IOS | Feb 19 16:04:19 192.168.178.66 19: *Mar 1 00:03:44: %SYS-5-CONFIG_I: | ||
+ | | Cisco XR | Feb 19 16:32:31 192.168.178.67 35: RP/ | ||
+ | | Cisco XE | Feb 19 17:26:01 192.168.178.57 54: *Feb 19 16: | ||
+ | | BIGIP F5 | Feb 19 17:37:39 < | ||
+ | | HP C5 | Feb 21 16:38:52 TE--RN01001 %%10SHELL/ | ||
+ | | HP C7 | Feb 19 17:48:55 < | ||
+ | | Arista EOS | Feb 19 17:56:48 < | ||
+ | | Aruba | Feb 20 11:52:41 < | ||
+ | | HP C5 | Feb 21 16:39:05 < | ||
+ | |||
+ | |||
+ | ====== Remarks ====== | ||
+ | |||
+ | syslog-ng | ||
+ | |||
+ | - syslog-ng is not managed by yce_psmon. It must be started as system facility | ||
+ | |||
+ | - DNS (reverse) resolver is not used in syslog-ng. Since NetYCE requires only a small subset of syslog events to catch configuration changes, this task befalls yce_events | ||
+ | |||
+ | - The syslog logfile, ''/ | ||
+ | |||
+ | - log rotation '/ | ||
+ | |||
+ | |||
+ | ======= Testlog.pl ======= | ||
+ | |||
+ | To perform functional and performance tests on the syslog-ng / yce_events setup the following perl script could be used as a base for generating spoofed syslog messages. | ||
+ | |||
+ | <file perl testlog.pl> | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | use lib "/ | ||
+ | use Common; | ||
+ | use File:: | ||
+ | use Time::HiRes qw(gettimeofday tv_interval sleep); | ||
+ | use Time:: | ||
+ | use Data:: | ||
+ | $Data:: | ||
+ | |||
+ | # use strict; | ||
+ | # use warnings; | ||
+ | |||
+ | use Sys::Syslog qw(: | ||
+ | |||
+ | $loghost = ' | ||
+ | # $proto = ' | ||
+ | $proto = ' | ||
+ | # $proto = ' | ||
+ | |||
+ | $ident = ' | ||
+ | $logopt = " | ||
+ | $facility = " | ||
+ | |||
+ | $rc = setlogsock($proto, | ||
+ | print " | ||
+ | |||
+ | $rc = openlog($ident, | ||
+ | print " | ||
+ | |||
+ | $level = ' | ||
+ | $message = "A $facility.$level syslog message to $loghost from $ident using $proto from $0: | ||
+ | |||
+ | |||
+ | print " | ||
+ | $rc = syslog(" | ||
+ | print " | ||
+ | |||
+ | 1; | ||
+ | </ | ||