Commit Graph

12 Commits

Author SHA1 Message Date
TVCABO MZ
1f19eb2146 Fix mysql bug in cisco-sla module (#10357)
* Update cisco-sla.inc.php

Fix SQL error during discovery of cisco-sla.
This error points to /opt/librenms/includes/discovery/cisco-sla.inc.php(80).

LOG ERROR:
[2019-06-18 07:07:01] production.ERROR: SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters (SQL: UPDATE slas set device_id=39,sla_nr=1,owner=,tag=xxx.xxx.xxx.xxx,rtt_type=echo,status=1,opstatus=0,deleted=0 WHERE sla_id = 5) (SQL: UPDATE slas set device_id=39,sla_nr=1,owner=,tag=xxx.xxx.xxx.xxx,rtt_type=echo,status=1,opstatus=0,deleted=0 WHERE sla_id = 5)#0 /opt/librenms/includes/discover
y/cisco-sla.inc.php(80): dbUpdate(Array, ‘slas’, ’sla_id = :sla…’, Array)
#1 /opt/librenms/includes/discovery/functions.inc.php(179): include(’/opt/librenms/i…’)
#2 /opt/librenms/discovery.php(120): discover_device(Array, false)
#3 {main}

I suggest to change this lines of code in cisco-sla.inc.php to avoid this error:

line 80: dbUpdate($data, ‘slas’, ’sla_id = :sla_id’, array(‘sla_id’ => $sla_id));
change to: dbUpdate($data, ‘slas’, ’sla_id = ?’, array($sla_id));

line 87: dbUpdate(array(‘deleted’ => 1), ‘slas’, ’sla_id = :sla_id’, array(‘sla_id’ => $existing_sla));
change to: dbUpdate(array(‘deleted’ => 1), ‘slas’, ’sla_id = ?’, array($existing_sla));

* Fix quotes

* Missed one
2019-06-21 07:16:19 -05:00
Tony Murray
b18c41b1a9 refactor: Use the Config class includes/discovery (#7299)
* refactor: use the Config class includes/discovery

* fix issue with $config variable not accessible in include-dir.inc.php

* improved whitespace

* Tidy up discovery_by_ip
2017-09-11 21:26:41 +01:00
Tony Murray
1d777693e1 feature: New IP parsing classes. Removes usage of Pear Net_IPv4 and Net_IPv6. (#7106)
* Refactor remove use of pear Net_IPv4 and Net_IPv6

Caution, I added tests to test the functionality of the new functions, but I'm not 100% certain the replaced usages match 100%.  Please test.

Left usage in generate-iplist.php because I'm not sure the use of that script, so I didn't want to implement additional functionality to support it.

Add support for ipv6 fo ipInNetwork() function

Add phpdocs to functions
Remove accidental inclusion

Use binary operations instead of string for networKFromIp()
Tidy up binary operations in ipInNetwork()

tidy parsing cidr network

Change to a class based implementation.

Update phpdocs.
Fully catch exceptions for hex parsing.

Fix mistake.

support older phpunit versions

Fix php shifting to negative with php 5

* Fix graph authorization. Uncaught exception and checking an ipv4 against an ipv6 network == fail.

* Also remove colons from hex strings.

* Fix typo in bgp polling
Two passes of removing invalid characters from hex strings. (That way we don't mangle valid IPs)
2017-08-08 14:14:58 -05:00
Tony Murray
90aa485149 refactor: discovery code cleanups (#6856)
* Use foreach $key => value

* use get_port_by_ifIndex
get rid of the rest of the array_keys()

* improve hex_to_ip() function, add tests, use in more places

* Simplify can_skip_discovery logic
2017-06-22 21:08:20 +01:00
Tony Murray
9284bc60ff Update code in includes to be PSR-2 compliant (#4220)
refactor: Update code in /includes to be psr2 compliant #4220
2016-08-28 18:32:58 +01:00
Aaron Daniels
ae7bb069ff - Change the IPSLA feature to allow different metrics to be collected per type.
- UDP Jitter metrics collected.
- Added opstatus code and DB field
- Discovery sets opstatus
- Added Status selector to SLA page
- Merged master and moved SQL
2016-08-09 06:59:17 +10:00
laf
558dfb2344 Pretty up the discovery process output 2016-06-21 00:59:43 +01:00
Aaron Daniels
659f31f3e7 Added tag to IPSLA type Jitter 2015-08-01 17:07:49 +10:00
Job Snijders
d8693f05ae Fix coding style part 2 2015-07-15 11:04:22 +02:00
Job Snijders
ebd0f6fc35 Apply "Squiz" code style on old (pre-2014) files 2015-07-11 16:12:35 +02:00
Tom Laermans
a10d3f75ea syntaxer run
git-svn-id: http://www.observium.org/svn/observer/trunk@3008 61d68cd4-352d-0410-923a-c4978735b2b8
2012-04-09 15:30:45 +00:00
Adam Amstrong
ab6d127956 add IPSLA support
git-svn-id: http://www.observium.org/svn/observer/trunk@3002 61d68cd4-352d-0410-923a-c4978735b2b8
2012-04-09 12:53:44 +00:00