Commit Graph

29 Commits

Author SHA1 Message Date
b47decdb00 Added add and remove parents for device from the V0 API (#11100)
* Added add and remove parents for device from the V0 API

* Fixed some minors errors (white spaces and lack of them, an unnecesary else)

* Added missing }

* Reducing cognitive complexity

* Further reduced cognitive complexity and added a check if parent device existed (it blew up when it did not)

* Refactored the code and fixed bugs (that i created) when deviceIds or parentIds where nonexistent

* Fixed } not on a new line issue

* Empty space removed

* Deleted lines added by mistake to composer.json

* removed a comma  that broke composer.json

* added the missing element in composer.json

* Added optional ids to del_parents_fom_host

Updated del_parents_from_host() so it can accept parent(s) id(s) to delete, if none given it deletes all it's parents.

* Fixing code issues on del_parents_from_host

Refactored and solved small issues with del_parents_from_host

* Refactored code del_parents_from_host

Refactored del_parents_from_host() in order to comply with the projects standard

* Added one space

Added missing whitespace

* refactoring for better readability
2020-02-13 22:28:43 +01:00
5bfc44f812 Location based Alert Rule (#11128)
* Location base Alert Rule

* travis fix
2020-02-12 12:53:26 -06:00
c8fab3a13f Add alert_rule filtering to API ROUTE "list_alerts" (#11109)
* Add alert_rule filtering to API ROUTE "list_alerts"

* move alert_rule filter before "order by"

* $_GET to $request->get

* spacing

* multiple empty-lines
2020-02-11 19:04:55 +01:00
7950893cd1 Alternate Poller IP instead of Hostname (#10981)
* optional alternative poller ip

* add missing schema update

* .

* enhance API Call 'add_device' with overwrite_ip key

* .

* .

* updating docs
2020-01-30 06:20:30 -06:00
3be82455fb Update oxidized model mapping for fortios (#10966) 2019-12-20 12:21:39 +01:00
ae7eee438f Adds API to fetch all inventory items for a given device (#10885)
Adds API to fetch all inventory items for a given device
2019-12-17 13:49:13 +01:00
4232bf2f36 API Call for triggering Device discovery (#10861) 2019-12-08 22:17:27 +01:00
96ed161c81 Add ability to fetch oxidized device config via the librenms API (#10913)
* Add get_oxidized_config api route

* Add "get_oxidized_config" function.

* add get_oxidized_config docs and fix typo in the search_oxidized docs.
2019-12-08 20:04:53 +01:00
2fa91fcbe7 Add interval extra var on API add_rule and edit_rule (#10814) 2019-11-14 18:46:11 +00:00
3872de40c7 IP address restriction for ip field in add_service_for_host removed as this restriction is not in the Web front end, and doesn't allow https sites to be added correctly. (#10810) 2019-11-14 18:45:41 +00:00
12773d125b API: list_arp search by MAC (#10803)
* API: Allow search ARP by MAC

* reformat mac

* Update docs
2019-11-13 02:21:07 +00:00
67169bf7b9 Create device groups via API (#10791)
* Add POST ability to devicegroups API endpoint

* Simplify function and make use of Lavarel validation for API request
2019-11-08 13:11:56 +00:00
717ecd4125 Fixed API arp cidr search (#10780) 2019-11-05 21:16:29 +00:00
7bebd6ba4a api: add hostname search for list_devices function (#10652)
* api: add domain type for list_devices function

api: add domain type query for list_devices

undo librenms-docker specification.

* api: list_devices change domain query by hostname. fix to search pattern in hostname

* Update Devices.md
2019-10-20 15:18:10 +00:00
25e8de30c1 Implement Oxidized "config search" as an API (#10648)
* Implement Oxidized config search as API

* Add Oxidized config search DOC.

* Update Devices.md

* change /configsearch/{searchstring} to /config/search/{searchstring}

* Update Devices.md
2019-10-17 02:46:44 +00:00
36c41bac2c Allowed device_ids as INT or as STRING (#10536) 2019-08-20 14:03:40 +02:00
f1c67ac5f4 Ports API: Workaround for ifNames with slashes (#10502)
* Workaround for ifNames with slashes

Basically,

/api/v0/devices/3/ports/0%2f4 -> /api/v0/devices/3/ports/ifName?ifName=0/4
/api/v0/devices/3/ports/0%2f4/port_bits -> /api/v0/devices/3/ports/ifName/port_bits?ifName=0/4

Or you can just use port_id.

* Fix API ports using ifName with slashes
hand parse the path for the ports graph endpoints
this way we can respect the original way of handling slashes (%2F)
2019-08-12 09:46:36 -05:00
01a519ef25 Watchguard Fireware is FirewareOS in oxidized (#10494) 2019-08-05 23:34:28 +02:00
89fae9be1d Move API routing to Laravel (#10457)
* Add more api helper functions
to centralize code more

* Enable cors

* Initial Legacy route in Laravel

* Force api v0 responses to json
Add a couple more routes

* more paths, pretty print the json response
pass parameters to the api function

* devices basic functions

* Port generic graph function
check permissions function accepts callback to avoid lots of if statements

* move vlans

* links

* graphs

* fdb

* health

* wireless

* port graphs

* ip functions
split em up

* port_stack

* components

* compoment add/edit/delete

* get_device_groups

* port stats

* port graphs

* get_devices_by_group

* port_groups

* api_get_graph

* show_endpoints

* get_bill

* get_bill_graph

* get_bill_graphdata

* get_bill_history

* get_bill_history_graph

* remaining bill functions

* list_alerts

* ack/unmute alert

* Some cleanups

* Some cleanups

* list_alert_rules

* alert rule add/edit/delete

* inventory

* list_cbgp

* vrf

* list_ipsec

* list_fdb

* list_links (fix both usages)

* list_locations

* list_locations

* list_vlans

* list_ip_addresses

* list_arp

* list_ip_networks

* cleanup

* services

* list_logs and fix authlog.......

* cleanup

* cleanup 2

* remove slim

* don't load schema more than once

* basic test

* fix style

* downgrade laravel-cors to a version that supports PHP 7.1
2019-07-29 16:32:37 -05:00
f3ba8947f7 Use Config helper (#10339)
remove usage of global variable
2019-06-23 00:29:12 -05:00
1a60c44eb0 Device groups rewrite (#10346)
* Device Groups rewrite
Updated web ui
Static or dynamic groups allowed
Alert rule query builder
Translation support
Permissions support

* cleanup, make relationship save, and validate it

* builder WIP

* rules builder and rules saving/loading

* Parse query builder to Laravel Fluent query

* Upgrade existing groups when editing.
Properly update only dynamic groups when polling.

* remove unused old code
Update API and other places to use Eloquent

* debug output in poller restored

* Fix up some things
creating static
improved validation
fix js error on creation
Fix static groups in polling

* hide pattern for static group

* Implement authorization
Use in the menu too

* update schema

* fix rollback

* Don't abort on invalid queries

* fixes to query builder

* add test data, looks like macros aren't handled (omitted them because groups don't use them generally)

* Add macro support for QueryBuilderFluentParser

* add test for macro that accepts value

* More space in forms
Retain rules when converted to static
no duplicate names allowed

* Better error feedback
Update related devices on save

* Add button icon

* format

* update docs

* fix tests

* Fix some QueryBuilderFluentParser issues with OR
updated/more test data

* Show device groups runtime
fix querybuilder.json format

* Store table joins in the rules to minimize polling time
Update group joins in daily.sh (and when they are saved)

* Update daily.php

* Add units to time
2019-06-19 16:01:53 -05:00
c2b09b8f80 Revert "Rewritten device groups (including static) (#10295)" (#10340)
This reverts commit cfc51d51f5.
2019-06-16 21:52:57 -05:00
cfc51d51f5 Rewritten device groups (including static) (#10295)
* Device Groups rewrite
Updated web ui
Static or dynamic groups allowed
Alert rule query builder
Translation support
Permissions support

* cleanup, make relationship save, and validate it

* builder WIP

* rules builder and rules saving/loading

* Parse query builder to Laravel Fluent query

* Upgrade existing groups when editing.
Properly update only dynamic groups when polling.

* remove unused old code
Update API and other places to use Eloquent

* debug output in poller restored

* Fix up some things
creating static
improved validation
fix js error on creation
Fix static groups in polling

* hide pattern for static group

* Implement authorization
Use in the menu too

* update schema

* fix rollback

* Don't abort on invalid queries

* fixes to query builder

* add test data, looks like macros aren't handled (omitted them because groups don't use them generally)

* Add macro support for QueryBuilderFluentParser

* add test for macro that accepts value

* More space in forms
Retain rules when converted to static
no duplicate names allowed

* Better error feedback
Update related devices on save

* Add button icon

* format

* update docs

* fix tests
2019-06-16 08:27:22 -05:00
882818d9f3 Fix location missing from API device list (#10215) 2019-05-13 09:45:19 -05:00
c097747d77 API Fix error when no fdb are found (#10125)
* Fix error when no fdb are found

* actually, it was totally broken...
fix untested

* missing device update

* cleanup

* Update api_functions.inc.php
2019-05-13 08:35:24 -05:00
af5377e06c Handle health sensors with underscores in the name. (#10123) 2019-04-27 17:10:31 +02:00
ae1b5bbfc1 Allowed Add_Device API to set sysName (#10124)
sysName is a valid option via the WebGUI to set when SNMP is turned off. Currently you cannot set this via the API add device. This is to enable setting the sysName via the API.
2019-04-27 09:15:59 +02:00
0a12ede577 Fixed api *log date format (#10133)
fixes #10089
2019-04-23 15:26:50 +02:00
36431dd296 Security fix: unauthorized access (#10091)
* Security fix: unauthorized access
Affects nginx users:
Moved php files outside of public html directory (Apache was protected by .htaccess)

Affects all users:
Some files did not check for authentication and could disclose some info.
Better checks before including files from user input

* git mv html/includes/ includes/html
git mv html/pages/ includes/html/
2019-04-11 23:26:42 -05:00