When it comes to network monitoring, monitoring logs is crucial for maintaining security and operational visibility. Syslog, a standard protocol for message logging, offers many advantages for transmitting, centralizing and managing different types of log messages.
In this article, we will explore what syslog facilities are, how they work within Paessler PRTG Network Monitor, specifically to help you monitor and troubleshoot your network, servers, and associated infrastructure.
What is a syslog facility?
Syslog facilities are designations used to indicate what types of messages are being sent to syslog. The facilities can be used for various things including splitting messages by the intended uses of the message. Ideally, these will help identify the component of a device or operating system that generated a particular log message.
It's essentially a categorization mechanism that helps administrators identify the source of syslog messages. It can also help us filter messages, for example if we do not want to forward debug messages, we could keep them locally on a system but not use them for monitoring.
The syslog protocol as defined in RFC5424 establishes several standard facilities, each represented by a numerical code known as a facility value:
Facility Number | Facility Name | Description |
---|---|---|
0 | kern | Kernel messages |
1 | user | User-level messages |
2 | Mail system | |
3 | daemon | System daemons |
4 | auth | Security/authorization messages |
5 | syslog | Messages generated internally by syslogd |
6 | lpr | Line printer subsystem |
7 | news | Network news subsystem |
8 | uucp | UUCP subsystem |
9 | cron | Clock daemon |
10 | authpriv | Security/authentication messages |
11 | ftp | FTP daemon |
12 | ntp | NTP subsystem |
13 | security | Log audit |
14 | console | Log alert |
15 | solaris-cron | Scheduling daemon |
16-23 | local0 - local7 | Local use facilities |
These facility codes help organize log messages and allow administrators to filter and route them appropriately. For example, all authentication-related logs might be directed to a specific security monitoring system, while printer-related logs might be sent elsewhere.
Syslog severity levels
In addition to facilities, syslog messages also include severity levels that indicate the importance or urgency of the message:
Level | Severity | Description |
---|---|---|
0 | Emergency | System is unusable |
1 | Alert | Immediate action required |
2 | Critical | Critical conditions |
3 | Error | Error conditions |
4 | Warning | Warning conditions |
5 | Notice | Normal but significant condition |
6 | Informational | Informational messages |
7 | Debug | Debug-level messages |
The combination of facility and severity creates what's called the "PRI" (priority) value of a syslog message, calculated using the formula: Priority = (Facility × 8) + Severity
How PRTG uses syslog facility
Paessler PRTG Network Monitor includes a powerful Syslog Receiver Sensor that can collect, analyze, and monitor syslog messages from various devices across your network, including Cisco devices, routers, and firewall appliances.
PRTG Syslog Receiver Sensor
The Syslog Receiver Sensor in PRTG acts as a syslog server, receiving and processing syslog messages from network devices. It displays important information including:
- The IP address of the message source
- Timestamp of the message
- The message content itself
- The header containing the facility code (source type)
- The severity level (logging level)
PRTG analyzes these components to help you identify potential issues and monitor your network effectively.
Key features of PRTG's syslog monitoring
- Facility and Severity Analysis: PRTG reads and processes both the facility value and syslog levels of incoming messages, allowing you to immediately identify the type and importance of each message.
- Custom Filtering: You can set up include, exclude, warning, and error filters to focus on specific types of messages and trigger appropriate alerts.
- Real-time Alerting: PRTG can notify you immediately when critical syslog messages are received, allowing for quick response to potential issues.
- Message Storage and Analysis: PRTG stores received messages in a log file, allowing you to review and analyze them later for troubleshooting or audit purposes.
- Visualization: PRTG provides visual representations of syslog data, making it easier to identify patterns and anomalies.
Configuring syslog monitoring in PRTG
To set up effective syslog monitoring in PRTG, follow these steps:
Step 1: Add a Syslog Receiver Sensor
- Navigate to your "Local Probe" (or a remote probe if you're using one)
- Choose "Add Sensor"
- Select "Syslog Receiver Sensor" from the "Various Protocols" section
Step 2: Configure basic settings
- Enter a listening port (default is 514 for UDP)
- Set how long PRTG should store received messages for analysis
- Configure any necessary filters:
- Include Filter: Define which messages to process
- Exclude Filter: Define which messages to discard
- Warning Filter: Define which messages should count as warnings
- Error Filter: Define which messages should count as errors
Step 3: Configure devices to send syslog messages
For each network device you want to monitor:
- Access the device's config interface
- Find the syslog or logging settings
- Configure the device to send syslog messages to your PRTG server's IP address on the port you specified
For Cisco devices, you might use commands like:
logging on logging host 192.168.1.100 logging trap warnings
For Linux or Unix systems, you would modify the syslog configuration file (typically `/etc/syslog.conf` or `/etc/rsyslog.conf`).
Advanced syslog filtering in PRTG
PRTG offers powerful filtering capabilities for syslog messages. You can create filters based on:
- Source IP address
- Facility value
- Severity levels
- Hostname
- Message content
- And more
Filters use a special syntax in the form of `field[filter]` and can be combined with boolean operators (AND, OR, NOT) and brackets.
For example:
- `facility[4]` - Match messages from the auth facility
- `severity[0-3]` - Match messages with severity Emergency through Error
- `message[Error]` - Match messages containing the word "Error"
Integration with other monitoring technologies
PRTG doesn't just handle syslog—it can integrate this data with other monitoring protocols like SNMP for a more comprehensive view of your network. This allows you to correlate syslog messages with performance metrics for better troubleshooting.
Additionally, PRTG's API allows you to extend its capabilities and integrate with other systems, enabling custom solutions for specialized environments like VMware infrastructures.
Best practices for syslog monitoring with PRTG
- Set appropriate severity thresholds: Configure your devices to send only relevant messages to avoid overwhelming your syslog server.
- Use targeted filters: Create specific filters to focus on critical issues and reduce noise.
- Implement centralized logging: Use PRTG as your central syslog server to collect logs from all network devices in one place.
- Configure meaningful alerts: Set up notifications for critical syslog messages to ensure timely response to issues.
- Regularly review logs: Periodically analyze stored logs to identify patterns and potential issues before they become critical.
- Correlate with other metrics: Combine syslog data with other monitoring metrics in PRTG for a more comprehensive view of your network's health.
- Secure your syslog traffic: Consider using encrypted transport for sensitive log data, especially from firewall and authentication systems.
Analyzing syslog data for network insights
A powerful syslog analyzer can help you extract valuable insights from your logs. For example:
- Tracking failed login attempts from auth facility messages to detect potential security breaches
- Monitoring kernel messages to identify hardware issues before they cause outages
- Analyzing router and firewall logs to optimize network traffic flows
- Reviewing mail system logs to ensure reliable email delivery
By properly configuring your logging facility settings across devices, you can create a comprehensive monitoring system that provides early warning of potential issues.
Conclusion
Syslog facility monitoring in PRTG provides a powerful way to centralize and analyze log data from across your network. By understanding how facilities and severity levels work together, you can effectively filter, prioritize, and respond to important system logs.
PRTG's Syslog Receiver Sensor offers comprehensive capabilities for collecting, analyzing, and alerting on syslog messages, making it an essential tool for network administrators looking to maintain security and operational efficiency.
By implementing the best practices outlined in this guide, you can leverage PRTG's syslog monitoring capabilities to gain deeper insights into your network and respond more effectively to potential issues requiring immediate action.