netniV / cisco-sfp

Cisco SFP Statistics for Cacti 1.x. This is to host code from the Cacti forums for others to use. I do not actively maintain this code, but welcome pull requests from others where they believe this can be improved. Cisco SFP Statistics for Cacti (c) 2007-2008 sodium in 2017
https://forums.cacti.net/viewtopic.php?f=19&t=23089 for others
GNU General Public License v2.0
8 stars 2 forks source link

Wrong readings on Cisco 3850 #10

Open pyron83 opened 1 year ago

pyron83 commented 1 year ago

I'm having a weird issue: when I read optic values from a Cisco 3850, I get same values scrambled with this script. For example I get the "Current (milliamperes)" value instead of the "Optical Receive Power (dBm)". I gave a look at the script but I think the indexing part is right. Do you have any idea?

pyron83 commented 1 year ago

If confirmed as a bug of some sort, I'll try upgrading Cacti from testing:

# apt install -t testing cacti
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libjs-c3 libjs-d3
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  libjs-d3-format libjs-jquery-jstree node-commander node-d3 node-d3-array node-d3-axis node-d3-brush node-d3-chord node-d3-collection node-d3-color node-d3-contour node-d3-dispatch node-d3-drag node-d3-dsv node-d3-ease node-d3-fetch node-d3-force node-d3-format
  node-d3-geo node-d3-hierarchy node-d3-interpolate node-d3-path node-d3-polygon node-d3-quadtree node-d3-queue node-d3-random node-d3-scale node-d3-scale-chromatic node-d3-selection node-d3-shape node-d3-time node-d3-time-format node-d3-timer node-d3-transition
  node-d3-voronoi node-d3-zoom node-iconv-lite node-rw node-safe-buffer node-ua-parser-js
Suggested packages:
  moreutils
The following NEW packages will be installed:
  libjs-d3-format node-commander node-d3 node-d3-array node-d3-axis node-d3-brush node-d3-chord node-d3-collection node-d3-color node-d3-contour node-d3-dispatch node-d3-drag node-d3-dsv node-d3-ease node-d3-fetch node-d3-force node-d3-format node-d3-geo node-d3-hierarchy
  node-d3-interpolate node-d3-path node-d3-polygon node-d3-quadtree node-d3-queue node-d3-random node-d3-scale node-d3-scale-chromatic node-d3-selection node-d3-shape node-d3-time node-d3-time-format node-d3-timer node-d3-transition node-d3-voronoi node-d3-zoom
  node-iconv-lite node-rw node-safe-buffer node-ua-parser-js
The following packages will be upgraded:
  cacti libjs-jquery-jstree
2 upgraded, 39 newly installed, 0 to remove and 798 not upgraded.
Need to get 29.9 MB of archives.
After this operation, 21.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.

doesn't look too invasive as dependencies (the previous deleted message was from the wrong server, sorry)

Luth1ng commented 1 year ago

There is no debug output of the db_fetch_cell, it's like you don't call the function whereas you should or the debug line isn't there. Can you send your db_fetch_cell block ?

Imo, you can just use the Cacti website and give up debian repo. You can easily make a custom install script or just use the mail announcement to get notified when a new version is available (https://sourceforge.net/projects/cacti/lists/cacti-announce).

netniV commented 1 year ago

Actually, that is my bad. Even though I wrote the function, I didn't actually look at it in a long time. The process only echoes to a log file in the system temp directory. So this in essence is a db_log_sql function.

If you locate the db_echo_sql function in database.php, beneath the file_put_contents, add a line:

echo get_debug_prefix() . $line;

I will look to improve this function since it doesn't quite do what you expect from its name and we should allow the admin to configure the location (and then fall back to default if it's not set).

pyron83 commented 1 year ago

Actually, that is my bad. Even though I wrote the function, I didn't actually look at it in a long time. The process only echoes to a log file in the system temp directory. So this in essence is a db_log_sql function.

If you locate the db_echo_sql function in database.php, beneath the file_put_contents, add a line:

echo get_debug_prefix() . $line;

I will look to improve this function since it doesn't quite do what you expect from its name and we should allow the admin to configure the location (and then fall back to default if it's not set).

found

function db_echo_sql($line, $force = false) {
        global $config;

        file_put_contents(sys_get_temp_dir() . '/cacti-sql.log', get_debug_prefix() . $line, FILE_APPEND);
}

so it should look like:

function db_echo_sql($line, $force = false) {
        global $config;

        file_put_contents(sys_get_temp_dir() . '/cacti-sql.log', get_debug_prefix() . $line, FILE_APPEND);
        echo get_debug_prefix() . $line;
}

?

pyron83 commented 1 year ago

it looks like we have the values now:


# "/usr/bin/php" -q /usr/share/cacti/site/scripts/ss_cisco_catalyst_sfp_querydescrdbg.php 'myhostname:169:2:161:500:1:10:mycommunity::::::' 'query' 'descr'  > /home/myuser/php-cacti-dbg; cat /home/myuser/php-cacti-dbg

---Debug enabled for query descr command---
<[ 2023-01-18 13:40:30.728066 | 2537280 ]> -- db_fetch_row_prepared('SELECT value FROM settings WHERE name = ?', $params = ('path_snmpbulkwalk'), $log = , $db_conn = false)
<[ 2023-01-18 13:40:30.728245 | 2537280 ]> -- db_Row_return_func: 'db_fetch_row_return' (1)
<[ 2023-01-18 13:40:30.728274 | 2537280 ]> -- db_Row_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'SELECT value FROM settings WHERE name = ?', )), )
<[ 2023-01-18 13:40:30.728290 | 2537280 ]> -- db_fetch_row_return($query)
<[ 2023-01-18 13:40:30.728358 | 2537280 ]> -- db_Row: returns array ( 'value' => '/usr/bin/snmpbulkwalk', )
<[ 2023-01-18 13:40:30.728400 | 2537280 ]> -- db_fetch_row_prepared('SELECT value FROM settings WHERE name = ?', $params = ('oid_increasing_check_disable'), $log = , $db_conn = false)
<[ 2023-01-18 13:40:30.728552 | 2537280 ]> -- db_Row_return_func: 'db_fetch_row_return' (1)
<[ 2023-01-18 13:40:30.728576 | 2537280 ]> -- db_Row_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'SELECT value FROM settings WHERE name = ?', )), )
<[ 2023-01-18 13:40:30.728599 | 2537280 ]> -- db_fetch_row_return($query)
<[ 2023-01-18 13:40:30.728621 | 2537280 ]> -- db_Row: returns array ( 'value' => 'on', )
<[ 2023-01-18 13:40:30.728649 | 2537280 ]> -- db_fetch_row_prepared('SELECT value FROM settings WHERE name = ?', $params = ('snmp_bulk_walk_size'), $log = , $db_conn = false)
<[ 2023-01-18 13:40:30.728808 | 2537280 ]> -- db_Row_return_func: 'db_fetch_row_return' (1)
<[ 2023-01-18 13:40:30.728831 | 2537280 ]> -- db_Row_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'SELECT value FROM settings WHERE name = ?', )), )
<[ 2023-01-18 13:40:30.728848 | 2537280 ]> -- db_fetch_row_return($query)
<[ 2023-01-18 13:40:30.728869 | 2537280 ]> -- db_Row: returns array ( 'value' => '10', )

----------

DBG1_sensor_name:GigabitEthernet1/0/1 Transmit Power Sensor
DBG2_elsematched: true
DBG3_index:1
<[ 2023-01-18 13:40:30.781735 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.781770 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.782043 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.782078 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select id from host where hostname = \'myhostname\'', )), )
<[ 2023-01-18 13:40:30.782107 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.782136 | 2537280 ]> -- db_Cell: returns false
DBG4_host_id:
<[ 2023-01-18 13:40:30.782169 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.782198 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.782596 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.782633 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select snmp_index from host_snmp_cache where host_id = \'\' and field_value = \'GigabitEthernet1/0/1\' and field_name = \'ifDescr\'', )), )
<[ 2023-01-18 13:40:30.782661 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.782692 | 2537280 ]> -- db_Cell: returns false
DBG5_snmp_index:
<[ 2023-01-18 13:40:30.782723 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.782752 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.783099 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.783133 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select field_value from host_snmp_cache where snmp_index=\'\' and host_id=\'\' and field_name=\'ifAlias\'', )), )
<[ 2023-01-18 13:40:30.783171 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.783200 | 2537280 ]> -- db_Cell: returns false
DBG6_alias:
DBG7_alias:

Function result for index 1090
1090:

----------

----------

DBG1_sensor_name:GigabitEthernet1/0/2 Transmit Power Sensor
DBG2_elsematched: true
DBG3_index:1
<[ 2023-01-18 13:40:30.784906 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.784936 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.785174 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.785209 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select id from host where hostname = \'myhostname\'', )), )
<[ 2023-01-18 13:40:30.785234 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.785261 | 2537280 ]> -- db_Cell: returns false
DBG4_host_id:
<[ 2023-01-18 13:40:30.785290 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.785315 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.785736 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.785782 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select snmp_index from host_snmp_cache where host_id = \'\' and field_value = \'GigabitEthernet1/0/2\' and field_name = \'ifDescr\'', )), )
<[ 2023-01-18 13:40:30.785807 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.785836 | 2537280 ]> -- db_Cell: returns false
DBG5_snmp_index:
<[ 2023-01-18 13:40:30.785864 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.785889 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.786273 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.786307 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select field_value from host_snmp_cache where snmp_index=\'\' and host_id=\'\' and field_name=\'ifAlias\'', )), )
<[ 2023-01-18 13:40:30.786332 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.786360 | 2537280 ]> -- db_Cell: returns false
DBG6_alias:
DBG7_alias:

Function result for index 1096
1096:

----------

----------

DBG1_sensor_name:GigabitEthernet1/0/3 Transmit Power Sensor
DBG2_elsematched: true
DBG3_index:1
<[ 2023-01-18 13:40:30.788166 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.788196 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.788447 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.788480 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select id from host where hostname = \'myhostname\'', )), )
<[ 2023-01-18 13:40:30.788505 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.788533 | 2537280 ]> -- db_Cell: returns false
DBG4_host_id:
<[ 2023-01-18 13:40:30.788561 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.788586 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.789007 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.789042 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select snmp_index from host_snmp_cache where host_id = \'\' and field_value = \'GigabitEthernet1/0/3\' and field_name = \'ifDescr\'', )), )
<[ 2023-01-18 13:40:30.789076 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.789103 | 2537280 ]> -- db_Cell: returns false
DBG5_snmp_index:
<[ 2023-01-18 13:40:30.789131 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.789157 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.789540 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.789574 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select field_value from host_snmp_cache where snmp_index=\'\' and host_id=\'\' and field_name=\'ifAlias\'', )), )
<[ 2023-01-18 13:40:30.789599 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.789626 | 2537280 ]> -- db_Cell: returns false
DBG6_alias:
DBG7_alias:

Function result for index 1102
1102:

----------

----------

DBG1_sensor_name:GigabitEthernet1/0/7 Transmit Power Sensor
DBG2_elsematched: true
DBG3_index:1
<[ 2023-01-18 13:40:30.791538 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.791567 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.791808 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.791843 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select id from host where hostname = \'myhostname\'', )), )
<[ 2023-01-18 13:40:30.791867 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.791903 | 2537280 ]> -- db_Cell: returns false
DBG4_host_id:
<[ 2023-01-18 13:40:30.791932 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.791957 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.792347 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.792381 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select snmp_index from host_snmp_cache where host_id = \'\' and field_value = \'GigabitEthernet1/0/7\' and field_name = \'ifDescr\'', )), )
<[ 2023-01-18 13:40:30.792406 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.792434 | 2537280 ]> -- db_Cell: returns false
DBG5_snmp_index:
<[ 2023-01-18 13:40:30.792462 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.792487 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.792895 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.792931 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select field_value from host_snmp_cache where snmp_index=\'\' and host_id=\'\' and field_name=\'ifAlias\'', )), )
<[ 2023-01-18 13:40:30.792956 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.792984 | 2537280 ]> -- db_Cell: returns false
DBG6_alias:
DBG7_alias:

Function result for index 1108
1108:

----------

----------

DBG1_sensor_name:GigabitEthernet1/0/8 Transmit Power Sensor
DBG2_elsematched: true
DBG3_index:1
<[ 2023-01-18 13:40:30.794832 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.794859 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.795090 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.795123 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select id from host where hostname = \'myhostname\'', )), )
<[ 2023-01-18 13:40:30.795156 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.795183 | 2537280 ]> -- db_Cell: returns false
DBG4_host_id:
<[ 2023-01-18 13:40:30.795212 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.795237 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.795632 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.795667 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select snmp_index from host_snmp_cache where host_id = \'\' and field_value = \'GigabitEthernet1/0/8\' and field_name = \'ifDescr\'', )), )
<[ 2023-01-18 13:40:30.795691 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.795718 | 2537280 ]> -- db_Cell: returns false
DBG5_snmp_index:
<[ 2023-01-18 13:40:30.795746 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.795772 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.796145 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.796178 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select field_value from host_snmp_cache where snmp_index=\'\' and host_id=\'\' and field_name=\'ifAlias\'', )), )
<[ 2023-01-18 13:40:30.796203 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.796231 | 2537280 ]> -- db_Cell: returns false
DBG6_alias:
DBG7_alias:

Function result for index 1114
1114:

----------

----------

DBG1_sensor_name:GigabitEthernet1/0/9 Transmit Power Sensor
DBG2_elsematched: true
DBG3_index:1
<[ 2023-01-18 13:40:30.798260 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.798290 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.798545 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.798580 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select id from host where hostname = \'myhostname\'', )), )
<[ 2023-01-18 13:40:30.798605 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.798633 | 2537280 ]> -- db_Cell: returns false
DBG4_host_id:
<[ 2023-01-18 13:40:30.798661 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.798687 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.799095 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.799129 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select snmp_index from host_snmp_cache where host_id = \'\' and field_value = \'GigabitEthernet1/0/9\' and field_name = \'ifDescr\'', )), )
<[ 2023-01-18 13:40:30.799154 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.799181 | 2537280 ]> -- db_Cell: returns false
DBG5_snmp_index:
<[ 2023-01-18 13:40:30.799209 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.799234 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.799609 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.799643 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select field_value from host_snmp_cache where snmp_index=\'\' and host_id=\'\' and field_name=\'ifAlias\'', )), )
<[ 2023-01-18 13:40:30.799675 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.799702 | 2537280 ]> -- db_Cell: returns false
DBG6_alias:
DBG7_alias:

Function result for index 1120
1120:

----------

----------

DBG1_sensor_name:GigabitEthernet1/0/10 Transmit Power Sensor
DBG2_elsematched: true
DBG3_index:1
<[ 2023-01-18 13:40:30.801478 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.801506 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.801768 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.801807 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select id from host where hostname = \'myhostname\'', )), )
<[ 2023-01-18 13:40:30.801835 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.801865 | 2537280 ]> -- db_Cell: returns false
DBG4_host_id:
<[ 2023-01-18 13:40:30.801893 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.801920 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.802312 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.802350 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select snmp_index from host_snmp_cache where host_id = \'\' and field_value = \'GigabitEthernet1/0/10\' and field_name = \'ifDescr\'', )), )
<[ 2023-01-18 13:40:30.802377 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.802407 | 2537280 ]> -- db_Cell: returns false
DBG5_snmp_index:
<[ 2023-01-18 13:40:30.802438 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.802467 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.802810 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.802850 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select field_value from host_snmp_cache where snmp_index=\'\' and host_id=\'\' and field_name=\'ifAlias\'', )), )
<[ 2023-01-18 13:40:30.802880 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.802910 | 2537280 ]> -- db_Cell: returns false
DBG6_alias:
DBG7_alias:

Function result for index 1126
1126:

----------

----------

DBG1_sensor_name:GigabitEthernet1/0/11 Transmit Power Sensor
DBG2_elsematched: true
DBG3_index:1
<[ 2023-01-18 13:40:30.804833 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.804863 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.805072 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.805107 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select id from host where hostname = \'myhostname\'', )), )
<[ 2023-01-18 13:40:30.805146 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.805176 | 2537280 ]> -- db_Cell: returns false
DBG4_host_id:
<[ 2023-01-18 13:40:30.805206 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.805233 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.805598 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.805630 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select snmp_index from host_snmp_cache where host_id = \'\' and field_value = \'GigabitEthernet1/0/11\' and field_name = \'ifDescr\'', )), )
<[ 2023-01-18 13:40:30.805669 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.805696 | 2537280 ]> -- db_Cell: returns false
DBG5_snmp_index:
<[ 2023-01-18 13:40:30.805725 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.805751 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.806072 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.806102 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select field_value from host_snmp_cache where snmp_index=\'\' and host_id=\'\' and field_name=\'ifAlias\'', )), )
<[ 2023-01-18 13:40:30.806128 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.806155 | 2537280 ]> -- db_Cell: returns false
DBG6_alias:
DBG7_alias:

Function result for index 1132
1132:

----------

----------

DBG1_sensor_name:GigabitEthernet1/0/15 Transmit Power Sensor
DBG2_elsematched: true
DBG3_index:1
<[ 2023-01-18 13:40:30.807891 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.807920 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.808233 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.808268 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select id from host where hostname = \'myhostname\'', )), )
<[ 2023-01-18 13:40:30.808295 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.808325 | 2537280 ]> -- db_Cell: returns false
DBG4_host_id:
<[ 2023-01-18 13:40:30.808356 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.808385 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.808751 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.808783 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select snmp_index from host_snmp_cache where host_id = \'\' and field_value = \'GigabitEthernet1/0/15\' and field_name = \'ifDescr\'', )), )
<[ 2023-01-18 13:40:30.808806 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.808835 | 2537280 ]> -- db_Cell: returns false
DBG5_snmp_index:
<[ 2023-01-18 13:40:30.808862 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.808896 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.809250 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.809280 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select field_value from host_snmp_cache where snmp_index=\'\' and host_id=\'\' and field_name=\'ifAlias\'', )), )
<[ 2023-01-18 13:40:30.809304 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.809331 | 2537280 ]> -- db_Cell: returns false
DBG6_alias:
DBG7_alias:

Function result for index 1138
1138:

----------

----------

DBG1_sensor_name:GigabitEthernet1/0/24 Transmit Power Sensor
DBG2_elsematched: true
DBG3_index:1
<[ 2023-01-18 13:40:30.811606 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.811635 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.811868 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.811910 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select id from host where hostname = \'myhostname\'', )), )
<[ 2023-01-18 13:40:30.811937 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.811968 | 2537280 ]> -- db_Cell: returns false
DBG4_host_id:
<[ 2023-01-18 13:40:30.811999 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.812028 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.812392 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.812427 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select snmp_index from host_snmp_cache where host_id = \'\' and field_value = \'GigabitEthernet1/0/24\' and field_name = \'ifDescr\'', )), )
<[ 2023-01-18 13:40:30.812452 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.812479 | 2537280 ]> -- db_Cell: returns false
DBG5_snmp_index:
<[ 2023-01-18 13:40:30.812510 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.812536 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.812910 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.812947 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select field_value from host_snmp_cache where snmp_index=\'\' and host_id=\'\' and field_name=\'ifAlias\'', )), )
<[ 2023-01-18 13:40:30.812975 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.813004 | 2537280 ]> -- db_Cell: returns false
DBG6_alias:
DBG7_alias:

Function result for index 1145
1145:

----------

----------

DBG1_sensor_name:TenGigabitEthernet1/1/3 Transmit Power Sensor
DBG2_elsematched: true
DBG3_index:1
<[ 2023-01-18 13:40:30.815876 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.815906 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.816140 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.816175 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select id from host where hostname = \'myhostname\'', )), )
<[ 2023-01-18 13:40:30.816219 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.816249 | 2537280 ]> -- db_Cell: returns false
DBG4_host_id:
<[ 2023-01-18 13:40:30.816279 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.816305 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.816674 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.816738 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select snmp_index from host_snmp_cache where host_id = \'\' and field_value = \'TenGigabitEthernet1/1/3\' and field_name = \'ifDescr\'', )), )
<[ 2023-01-18 13:40:30.816767 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.816798 | 2537280 ]> -- db_Cell: returns false
DBG5_snmp_index:
<[ 2023-01-18 13:40:30.816830 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.816859 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.817229 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.817265 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select field_value from host_snmp_cache where snmp_index=\'\' and host_id=\'\' and field_name=\'ifAlias\'', )), )
<[ 2023-01-18 13:40:30.817300 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.817330 | 2537280 ]> -- db_Cell: returns false
DBG6_alias:
DBG7_alias:

Function result for index 1153
1153:

----------

----------

DBG1_sensor_name:GigabitEthernet2/0/1 Transmit Power Sensor
DBG2_elsematched: true
DBG3_index:1
<[ 2023-01-18 13:40:30.819044 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.819074 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.819375 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.819412 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select id from host where hostname = \'myhostname\'', )), )
<[ 2023-01-18 13:40:30.819441 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.819472 | 2537280 ]> -- db_Cell: returns false
DBG4_host_id:
<[ 2023-01-18 13:40:30.819504 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.819533 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.819907 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.819942 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select snmp_index from host_snmp_cache where host_id = \'\' and field_value = \'GigabitEthernet2/0/1\' and field_name = \'ifDescr\'', )), )
<[ 2023-01-18 13:40:30.819969 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.819998 | 2537280 ]> -- db_Cell: returns false
DBG5_snmp_index:
<[ 2023-01-18 13:40:30.820026 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.820055 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.820396 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.820432 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select field_value from host_snmp_cache where snmp_index=\'\' and host_id=\'\' and field_name=\'ifAlias\'', )), )
<[ 2023-01-18 13:40:30.820461 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.820491 | 2537280 ]> -- db_Cell: returns false
DBG6_alias:
DBG7_alias:

Function result for index 2090
2090:

----------

----------

DBG1_sensor_name:GigabitEthernet2/0/2 Transmit Power Sensor
DBG2_elsematched: true
DBG3_index:1
<[ 2023-01-18 13:40:30.822063 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.822095 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.822327 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.822363 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select id from host where hostname = \'myhostname\'', )), )
<[ 2023-01-18 13:40:30.822391 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.822421 | 2537280 ]> -- db_Cell: returns false
DBG4_host_id:
<[ 2023-01-18 13:40:30.822452 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.822488 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.822852 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.822894 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select snmp_index from host_snmp_cache where host_id = \'\' and field_value = \'GigabitEthernet2/0/2\' and field_name = \'ifDescr\'', )), )
<[ 2023-01-18 13:40:30.822923 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.822953 | 2537280 ]> -- db_Cell: returns false
DBG5_snmp_index:
<[ 2023-01-18 13:40:30.822983 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.823010 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.823359 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.823400 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select field_value from host_snmp_cache where snmp_index=\'\' and host_id=\'\' and field_name=\'ifAlias\'', )), )
<[ 2023-01-18 13:40:30.823427 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.823457 | 2537280 ]> -- db_Cell: returns false
DBG6_alias:
DBG7_alias:

Function result for index 2096
2096:

----------

----------

DBG1_sensor_name:GigabitEthernet2/0/3 Transmit Power Sensor
DBG2_elsematched: true
DBG3_index:1
<[ 2023-01-18 13:40:30.825273 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.825305 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.825513 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.825548 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select id from host where hostname = \'myhostname\'', )), )
<[ 2023-01-18 13:40:30.825575 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.825605 | 2537280 ]> -- db_Cell: returns false
DBG4_host_id:
<[ 2023-01-18 13:40:30.825635 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.825664 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.826038 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.826074 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select snmp_index from host_snmp_cache where host_id = \'\' and field_value = \'GigabitEthernet2/0/3\' and field_name = \'ifDescr\'', )), )
<[ 2023-01-18 13:40:30.826101 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.826131 | 2537280 ]> -- db_Cell: returns false
DBG5_snmp_index:
<[ 2023-01-18 13:40:30.826161 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.826189 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.826538 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.826571 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select field_value from host_snmp_cache where snmp_index=\'\' and host_id=\'\' and field_name=\'ifAlias\'', )), )
<[ 2023-01-18 13:40:30.826599 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.826628 | 2537280 ]> -- db_Cell: returns false
DBG6_alias:
DBG7_alias:

Function result for index 2102
2102:

----------

----------

DBG1_sensor_name:GigabitEthernet2/0/13 Transmit Power Sensor
DBG2_elsematched: true
DBG3_index:1
<[ 2023-01-18 13:40:30.828205 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.828235 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.828449 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.828488 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select id from host where hostname = \'myhostname\'', )), )
<[ 2023-01-18 13:40:30.828516 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.828556 | 2537280 ]> -- db_Cell: returns false
DBG4_host_id:
<[ 2023-01-18 13:40:30.828587 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.828615 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.828986 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.829020 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select snmp_index from host_snmp_cache where host_id = \'\' and field_value = \'GigabitEthernet2/0/13\' and field_name = \'ifDescr\'', )), )
<[ 2023-01-18 13:40:30.829046 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.829073 | 2537280 ]> -- db_Cell: returns false
DBG5_snmp_index:
<[ 2023-01-18 13:40:30.829101 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.829128 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.829460 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.829493 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select field_value from host_snmp_cache where snmp_index=\'\' and host_id=\'\' and field_name=\'ifAlias\'', )), )
<[ 2023-01-18 13:40:30.829517 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.829545 | 2537280 ]> -- db_Cell: returns false
DBG6_alias:
DBG7_alias:

Function result for index 2108
2108:

----------

----------

DBG1_sensor_name:GigabitEthernet2/0/14 Transmit Power Sensor
DBG2_elsematched: true
DBG3_index:1
<[ 2023-01-18 13:40:30.831295 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.831324 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.831536 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.831571 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select id from host where hostname = \'myhostname\'', )), )
<[ 2023-01-18 13:40:30.831599 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.831628 | 2537280 ]> -- db_Cell: returns false
DBG4_host_id:
<[ 2023-01-18 13:40:30.831661 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.831689 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.832052 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.832088 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select snmp_index from host_snmp_cache where host_id = \'\' and field_value = \'GigabitEthernet2/0/14\' and field_name = \'ifDescr\'', )), )
<[ 2023-01-18 13:40:30.832116 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.832146 | 2537280 ]> -- db_Cell: returns false
DBG5_snmp_index:
<[ 2023-01-18 13:40:30.832177 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.832206 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.832553 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.832594 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select field_value from host_snmp_cache where snmp_index=\'\' and host_id=\'\' and field_name=\'ifAlias\'', )), )
<[ 2023-01-18 13:40:30.832622 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.832658 | 2537280 ]> -- db_Cell: returns false
DBG6_alias:
DBG7_alias:

Function result for index 2114
2114:

----------

----------

DBG1_sensor_name:GigabitEthernet2/0/15 Transmit Power Sensor
DBG2_elsematched: true
DBG3_index:1
<[ 2023-01-18 13:40:30.834550 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.834582 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.834872 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.834908 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select id from host where hostname = \'myhostname\'', )), )
<[ 2023-01-18 13:40:30.834935 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.834965 | 2537280 ]> -- db_Cell: returns false
DBG4_host_id:
<[ 2023-01-18 13:40:30.834997 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.835025 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.835427 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.835460 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select snmp_index from host_snmp_cache where host_id = \'\' and field_value = \'GigabitEthernet2/0/15\' and field_name = \'ifDescr\'', )), )
<[ 2023-01-18 13:40:30.835489 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.835517 | 2537280 ]> -- db_Cell: returns false
DBG5_snmp_index:
<[ 2023-01-18 13:40:30.835548 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.835576 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.835919 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.835954 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select field_value from host_snmp_cache where snmp_index=\'\' and host_id=\'\' and field_name=\'ifAlias\'', )), )
<[ 2023-01-18 13:40:30.835982 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.836012 | 2537280 ]> -- db_Cell: returns false
DBG6_alias:
DBG7_alias:

Function result for index 2120
2120:

----------

----------

DBG1_sensor_name:TenGigabitEthernet2/1/3 Transmit Power Sensor
DBG2_elsematched: true
DBG3_index:1
<[ 2023-01-18 13:40:30.837428 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.837458 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.838685 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.838722 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select id from host where hostname = \'myhostname\'', )), )
<[ 2023-01-18 13:40:30.838749 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.838779 | 2537280 ]> -- db_Cell: returns false
DBG4_host_id:
<[ 2023-01-18 13:40:30.838810 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.838838 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.839246 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.839283 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select snmp_index from host_snmp_cache where host_id = \'\' and field_value = \'TenGigabitEthernet2/1/3\' and field_name = \'ifDescr\'', )), )
<[ 2023-01-18 13:40:30.839311 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.839340 | 2537280 ]> -- db_Cell: returns false
DBG5_snmp_index:
<[ 2023-01-18 13:40:30.839370 | 2537280 ]> -- db_fetch_cell($sql, $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.839397 | 2537280 ]> -- db_fetch_cell_prepared($sql, $params = array ( ), $col_name = '', $log = true, $db_conn = false)
<[ 2023-01-18 13:40:30.839769 | 2537280 ]> -- db_Cell_return_func: 'db_fetch_cell_return' (1)
<[ 2023-01-18 13:40:30.839803 | 2537280 ]> -- db_Cell_return_func: params array ( 0 => PDOStatement::__set_state(array( 'queryString' => 'select field_value from host_snmp_cache where snmp_index=\'\' and host_id=\'\' and field_name=\'ifAlias\'', )), )
<[ 2023-01-18 13:40:30.839830 | 2537280 ]> -- db_fetch_cell_return($query, $col_name = '')
<[ 2023-01-18 13:40:30.839860 | 2537280 ]> -- db_Cell: returns false
DBG6_alias:
DBG7_alias:

Function result for index 2127
2127:

----------
netniV commented 1 year ago

Yeah, that looks better... I don't have time right now to go through the log, so I will have to check back in later unless @Luth1ng beats me to it.

Luth1ng commented 1 year ago

The script cannot find your devices inside the mysql db, but the function seems to work for getting settings. Please try manually requesting the db :

mysql -u <user/default is 'root'> -p use <cactidb/default is 'cact'"; select id,hostname from host where hostname='myhostname.mydomain.com';

Paste the output

pyron83 commented 1 year ago

The script cannot find your devices inside the mysql db, but the function seems to work for getting settings. Please try manually requesting the db :

mysql -u <user/default is 'root'> -p use <cactidb/default is 'cact'"; select id,hostname from host where hostname='myhostname';

Paste the output

MariaDB [cacti]> select id,hostname from host where hostname='myhostname.mydomain.com'; +-----+---------------------------+ | id | hostname | +-----+---------------------------+ | 169 | myhostname.mydomain.com | +-----+---------------------------+ 1 row in set (0.000 sec)

Luth1ng commented 1 year ago

@pyron83 done

Just to summarize things up :

@netniV could you please help ?

pyron83 commented 1 year ago

@pyron83 done

Just to summarize things up :

* Your SS cannot get interface details through the internal mysql db, but the script seems to work (you get valid snmp data)

* The db_fetch_cell function to get sql data is working inside the script, as it get values when requesting "settings" table

* You can manually request the "host" table and get valid values for your hostname

@netniV could you please help ?

Weird, as far as I can understand

All other graphs are working, I mean this is the Cacti we're using on production to graph and threshold all the network devices we've here.

pyron83 commented 1 year ago

any idea?

netniV commented 1 year ago

Unfortunately, I have been tied up with other urgent things. I may be able to take a look at the weekend, hopefully.

pyron83 commented 1 year ago

Tried today to upgrade from 1.2.16 of debian-stable to cacti 1.2.23 from debian-testing, SFP graphs are still "-nan" so I assume it's not a Cacti problem. Tried also recreating those graphs from scratch, still"-nan". Reverted to previous hyper-v checkpoint with cacti 1.2.16 from debian-stable

pyron83 commented 1 year ago

ok so:

1) https://github.com/netniV/cisco-sfp/issues/12#issuecomment-1410672973

this fix the "-nan" problem

I believe you may add a pull request, it's just one line adding the environment php binary

2) after this, I had still to upgrade to cacti 1.2.2.3 from debian-testing, it looks like that cacti 1.2.16 from debian-stable has some kind of random bug at indexing stuff (1 of the switches had wrong indexes, still the manual 'snmpwalk' would work and retrieve the correct indexes). @paulgevers

pyron83 commented 1 year ago

@Luth1ng I suggest to put "#!/usr/bin/env php" at beginning of "ss_cisco_catalyst_sfp.php", it should fix the "-nan" problemi for most users. Still upgrading to Cacti 1.2.23 is recommended to fix the indexing bug (@paulgevers)

netniV commented 1 year ago

Apologies for being absent, so much to do, so little time.

That line should do nothing except allow shells to determine which interpreter / cmd to use to run the script. When included by script server, or being called with php in front of it, it is basically ignored as far as I know. I can add it though if @Luth1ng confirms no issues with it.

However, the engine will NOT ignore the first #! line of any included files withing your "outer" script.php. Any "shebang" line in an included script, will result in simply outputting the line to STDOUT, just as any other text residing outside a <?php ... ?> block.

Since Script Server includes the script, not executes it, this would result in stray output. The fact that this stray output fixes your problem is most curious.

netniV commented 1 year ago

Can I clarify, are you using CMD or Spine for processing?

TheWitness commented 1 year ago

Hrm, sorry about that. The real answer is that the script server is always included, and then the function is called from within the script server.

However, when called as a data query script for both indexing and query methods, it's called directly, but with php -q script.php index for example, so shbang is useless.

pyron83 commented 1 year ago

Can I clarify, are you using CMD or Spine for processing?

Spine.

I still confirm that shebang fixed my problem.

I also understand your comment "Since Script Server includes the script, not executes it, this would result in stray output. The fact that this stray output fixes your problem is most curious."

I really don't know what to say about this, something to with Debian? I don't really know.

netniV commented 1 year ago

It's possible it causes script server to reset/restart or something.

netniV commented 1 year ago

Please can you run spine/cmd in debug mode for that host using the highest level of output. Send me the output to netniv@cacti.net and I'll review it to see if it shows why that output would fix things for you?

pyron83 commented 1 year ago

Hi netniv,

I pinned your post, but I'm not able to fulfill the task actually, I'm too busy.

I'll keep this tab pinned as a reminder.

Thanks

pyron83 commented 1 year ago

HI netniv, I tried running Spine in debug mode on the host, but it's a lot of stuff in the logs. Is there something more precise I can filter for you?

netniV commented 1 year ago

I'd rather not have a filter logas it may mask something when I am trying to read through it.

pyron83 commented 1 year ago

output sent

netniV commented 1 year ago

Sorry, @pyron83 only just seen this, I will try and take a look over the weekend.

netniV commented 1 year ago

OK, I did review this but it appears to be from the Cacti log side. If you could run this again against the device in question, using -V 5 -R options (max logging and readonly) then send an output with and without the shebangs in place so I can compare the difference. But this must be done from the command line not the cacti logs since there is often more output on the command line than seen in the logs.

pyron83 commented 1 year ago

OK, I did review this but it appears to be from the Cacti log side. If you could run this again against the device in question, using -V 5 -R options (max logging and readonly) then send an output with and without the shebangs in place so I can compare the difference. But this must be done from the command line not the cacti logs since there is often more output on the command line than seen in the logs.

Hi NetniV.

Sorry, I don't run often Cacti from the CLI, which command would it be to which I should add "-V 5 -R"?

Thanks

pyron83 commented 1 year ago

in the end I figured out, you probably wanted me to run ' /usr/sbin/spine -V 5 -R -f "169" -l "169" '

without shebang, immediately I noticed this error/difference from the run WITH shebang:

/usr/share/cacti/site/scripts/ss_cisco_catalyst_sfp.php: 1: cannot open ?php: No such file
/usr/share/cacti/site/scripts/ss_cisco_catalyst_sfp.php: 2: /1: Permission denied
/usr/share/cacti/site/scripts/ss_cisco_catalyst_sfp.php: 3: +-------------------------------------------------------------------------+: not found
/usr/share/cacti/site/scripts/ss_cisco_catalyst_sfp.php: 4: Syntax error: "|" unexpected

and investigating the '/usr/share/cacti/site/scripts' folder, I noticed that every PHP script in this directory has the shebang:

:/usr/share/cacti/site/scripts# head ss_fping.php
#!/usr/bin/env php
<?php
/*
 +-------------------------------------------------------------------------+
 | Copyright (C) 2004-2023 The Cacti Group                                 |
 |                                           

I would like to say that I put the shebang in every of this file, but I never did, they are all like this from years, from when I added them to Cacti on this host