Skip to content

Commit

Permalink
Fixing Issue #4641 - Save total snmp_ports into settings table for spine
Browse files Browse the repository at this point in the history
This change, when combined with a to be committed spine change will help improve performance of spine on very busy systems where the default snmp port is the only one in use.
  • Loading branch information
TheWitness committed Mar 22, 2022
1 parent d28f948 commit 8956e34
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ Cacti CHANGELOG
-feature#4631: Additional choices for Heartbeat when creating a Data Source Profile
-feature#4636: jQueryMulti-select 3.0.1 includes i18n upgrade to it
-feature#4637: Have Cacti's MultiSelect CheckAll and UnCheckAll use Font-Awesome
-feature#4641: Improve spine performance by storing the total number of system snmp_ports in use

1.2.19
-security#4356: Further fixes for grave character security protection
Expand Down
13 changes: 12 additions & 1 deletion poller.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,18 @@ function sig_handler($signo) {
}
}

/* determine the number of active profiles to improve poller performance
/**
* shortcut some expensive logic in spine if possible the
* order by snmp port is a rare thing to be needed and only
* needs to occur if your are talking to more than one snmp
* agent on a host.
*/
$total_ports = db_fetch_cell('SELECT COUNT(DISTINCT snmp_port)
FROM poller_item');
set_config_option('total_snmp_ports', $total_ports);

/**
* determine the number of active profiles to improve poller performance
* under some circumstances. Save this data for spine and cmd.php.
*/
$active_profiles = db_fetch_cell('SELECT COUNT(DISTINCT data_source_profile_id)
Expand Down

0 comments on commit 8956e34

Please sign in to comment.