-
Notifications
You must be signed in to change notification settings - Fork 16
Add option to map syslog hosts to Cacti Database #237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
mismathc between syslog_incoming and syslog table
Don't assume that $hosts returns an array, it can return false, which will generate a fatal error.
More light formatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds functionality to map syslog hosts (particularly those sending from IP addresses) to their corresponding Cacti host descriptions, and increases the syslog message column size to accommodate longer messages.
- Adds a new configuration option to enable mapping syslog hosts to Cacti database hosts
- Increases the
messagecolumn size from 1024 to 2048 characters in the partitioned syslog table - Implements host-to-Cacti mapping logic that validates IP addresses and updates incoming syslog records
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| setup.php | Increases message column length and adds new configuration checkbox for host mapping feature |
| functions.php | Implements the host mapping logic with new function and integration into reference table updates; adds guard check for existing hostname validation |
| CHANGELOG.md | Documents the new feature and column length fix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| WHERE host = ?", | ||
| array($cacti_hostname, $host['host'])); |
Copilot
AI
Nov 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UPDATE statement is missing a filter on the status column. This could potentially update hosts from other processing batches. Add AND status = ? to the WHERE clause and include $uniqueID in the parameters array, similar to the pattern used in line 1834-1837.
| WHERE host = ?", | |
| array($cacti_hostname, $host['host'])); | |
| WHERE host = ? AND status = ?", | |
| array($cacti_hostname, $host['host'], $uniqueID)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont know about this one
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
No description provided.