diff --git a/doc/Extensions/Syslog.md b/doc/Extensions/Syslog.md index cb0ef8a0b..1deb197ae 100644 --- a/doc/Extensions/Syslog.md +++ b/doc/Extensions/Syslog.md @@ -4,6 +4,8 @@ This document will explain how to send syslog data to LibreNMS. ### Syslog server installation +#### syslog-ng + For Debian / Ubuntu: ```ssh apt-get install syslog-ng @@ -81,6 +83,43 @@ Add the following to your LibreNMS config.php file to enable the Syslog extensio $config['enable_syslog'] = 1; ``` +#### rsyslog + +If you prefer rsyslog, here are some hints on how to get it working. + +Add the following to your rsyslog config somewhere (could be at the top of the file in the step below, could be in `rsyslog.conf` if you are using remote logs for something else on this host) + +```ssh +# Listen for syslog messages on UDP:514 +$ModLoad imudp +$UDPServerRun 514 +``` + +Create a file called something like `/etc/rsyslog.d/30-librenms.conf` containing: + +```ssh +# Feed syslog messages to librenms +$ModLoad omprog + +$template librenms,"%fromhost%||%syslogfacility%||%syslogpriority%||%syslogseverity%||%syslogtag%||%$year%-%$month%-%$day% %timereported:8:25%||%msg%||%programname%\n" + +:inputname, isequal, "imudp" action(type="omprog" + binary="/opt/librenms/syslog.php" + template="librenms") +& stop + +``` + +Ancient versions of rsyslog may require different syntax. + +If your rsyslog server is recieving messages relayed by another syslog server, you may try replacing `%fromhost%` with `%hostname%`, since `fromhost` is the host the message was received from, not the host that generated the message. The `fromhost` property is preferred as it avoids problems caused by devices sending incorrect hostnames in syslog messages. + +Add the following to your LibreNMS `config.php` file to enable the Syslog extension: + +```ssh +$config['enable_syslog'] = 1; +``` + ### Client configuration Below are sample configurations for a variety of clients. You should understand the config before using it as you may want to make some slight changes. diff --git a/html/includes/print-map.inc.php b/html/includes/print-map.inc.php index 515fc68f4..9c28a0b34 100644 --- a/html/includes/print-map.inc.php +++ b/html/includes/print-map.inc.php @@ -39,6 +39,20 @@ $tmp_link_ids = array(); $ports = array(); $devices = array(); +$where = ""; +if (is_numeric($vars['group'])) { + $group = dbFetchRows('SELECT `pattern`, `name`, `description` FROM `device_groups` WHERE id = '.$vars['group']); + $group_pattern = rtrim($group['pattern'], '&&'); + $group_pattern = rtrim($group_pattern, '||'); + $group_name = $group['name']; + $group_description = $group['group_descriptio']; + + $device_id_sql = GenGroupSQL($group_pattern); + if ($device_id_sql) { + $where .= " AND D1.device_id IN ($device_id_sql) OR D2.device_id IN ($device_id_sql)"; + } +} + if (in_array('mac',$config['network_map_items'])) { $ports = dbFetchRows("SELECT `D1`.`device_id` AS `local_device_id`, @@ -74,6 +88,7 @@ if (in_array('mac',$config['network_map_items'])) { `P1`.`port_id` IS NOT NULL AND `P2`.`port_id` IS NOT NULL AND `D1`.`device_id` != `D2`.`device_id` + $where $sql GROUP BY `P1`.`port_id`,`P2`.`port_id` ", $sql_array); @@ -115,6 +130,7 @@ if (in_array('xdp', $config['network_map_items'])) { `remote_device_id` != 0 AND `local_device_id` IS NOT NULL AND `remote_device_id` IS NOT NULL + $where $sql GROUP BY `P1`.`port_id`,`P2`.`port_id` ", $sql_array); @@ -232,4 +248,5 @@ else { } +if (is_numeric($vars['group'])) { $pagetitle[] = "Map"; diff --git a/html/includes/print-menubar.php b/html/includes/print-menubar.php index 4c22ad08b..0f4268be1 100644 --- a/html/includes/print-menubar.php +++ b/html/includes/print-menubar.php @@ -48,14 +48,14 @@ else {