Commit Graph

2970 Commits

Author SHA1 Message Date
Gunnar Beutner de847d0b6f Don't allow scripts to access FANoUserView attributes in sandbox mode
fixes #10457
2015-10-26 10:41:00 +01:00
Gunnar Beutner 13375d74fc Fix: Changing a group's attributes causes duplicate rows in the icinga_*group_members table
fixes #10422
2015-10-26 09:36:13 +01:00
Mhd Sulhan 977d94839b CLI: Hide "Command options" if command is null
Before this commit, if icinga2 command executed without any argument,
the program will print empty "Command options".

While at it, clean the whitespaces.

fixes #10439

Signed-off-by: Gunnar Beutner <gunnar@beutner.name>
2015-10-26 08:05:09 +01:00
Gunnar Beutner 618e031f46 Handle exceptions for NetString::WriteStringToStream in ApiListener::ReplayLog
fixes #10455
2015-10-26 07:56:58 +01:00
Gunnar Beutner 12015e0eca Clean up the 'api setup' command a bit more
refs #9471
2015-10-26 07:03:41 +01:00
Gunnar Beutner b72ba2b63a Fix incorrect return value for ApiSetupUtility::SetupMaster
refs #9471
2015-10-25 19:57:57 +01:00
Gunnar Beutner fd2cd7a3a5 Use operator[] instead of insert() for Dictionary::Set
refs #10428
2015-10-23 06:19:46 +02:00
Gunnar Beutner f31837a6ba Clean up the 'api setup' command
refs #9471
2015-10-22 16:03:26 +02:00
Michael Friedrich d618762dad Export original attributes in DB IDO and Livestatus
fixes #10392
2015-10-22 15:49:42 +02:00
Michael Friedrich d516d16c9a Fix restore_attribute not working in clusters
fixes #10386
2015-10-22 14:50:43 +02:00
Gunnar Beutner 1b8fd9637f Add redirect for /
refs #9105
2015-10-22 13:29:31 +02:00
Gunnar Beutner 10bd3ed9b7 Implement URL handler for /v1
refs #9105
2015-10-22 12:15:32 +02:00
Jean Flach be320b2f77 Update API actions
fixes #10180
refs #9080
2015-10-22 11:33:26 +02:00
Gunnar Beutner 4aa0165701 Add getter for endpoint 'connected' attribute
fixes #10394
2015-10-22 10:52:38 +02:00
Gunnar Beutner 3473731034 Remove api.cpp and api.hpp
fixes #10407
2015-10-22 10:26:56 +02:00
Gunnar Beutner 74ef3e3ce6 Turn includes into AST expressions
fixes #10008
2015-10-22 09:46:31 +02:00
Gunnar Beutner fd5d6de52e Improve performance for Livestatus queries
refs #10428
2015-10-22 08:28:40 +02:00
Michael Friedrich 62c3607531 Fix compiler warnings
refs #9078
2015-10-21 15:50:32 +02:00
Michael Friedrich cb99402766 Fix filter permissions in event streams
refs #9078
2015-10-21 15:38:26 +02:00
Michael Friedrich 286538c17e Implement api event streams
Documentation is not yet complete.

refs #9078
2015-10-21 15:34:26 +02:00
Gunnar Beutner e93dd3cf15 Ensure that the main thread pool gets re-initialized properly after fork()
refs #10410
2015-10-21 09:18:52 +02:00
Gunnar Beutner 3c6f0e31d9 Make sure the timer thread is gone when calling fork()
refs #10410
2015-10-20 23:02:11 +02:00
Gunnar Beutner 438210651f Build fix for OpenBSD 2015-10-20 22:54:58 +02:00
Jean Flach 6b92c6028b Reword nodeutility output
The old comment had a few minor problems:
* Two spaces after 'named'
* No space between // and the begining of the message
* Incorrect capitalization

And one major:
* Incorrectly calling a zone a node

But all of this is subject to change through the use of the configwriter
anyways.

fixes #10406
2015-10-20 12:56:26 +02:00
Gunnar Beutner d01f09f3ef Hide internal attributes in the API
fixes #10393
2015-10-20 08:25:10 +02:00
Gunnar Beutner b77c9edca0 Remove unnecessary default values
refs #9461
refs #8149
2015-10-20 08:06:25 +02:00
Gunnar Beutner 5aa91551a5 Improve validation for CIDR masks
fixes #10375
2015-10-19 10:40:48 +02:00
Michael Friedrich f51a76e13d Log a warning message on unauthorized http request
fixes #10388
2015-10-16 15:32:35 +02:00
Gunnar Beutner a9f14f11e4 Fix query processing for Livestatus queries which use KeepAlive
fixes #9322
2015-10-16 15:12:05 +02:00
Michael Friedrich ed00ab04c7 Fix OSX control sequence
refs #9095
2015-10-16 13:46:43 +02:00
Michael Friedrich c3385e6e38 DB IDO should provide its connected state via /v1/status
fixes #10383
2015-10-16 13:02:41 +02:00
Michael Friedrich 6cc4f85c66 Disallow modify attribute for certain object attributes
fixes #9095
2015-10-16 12:44:08 +02:00
Michael Friedrich 498ff3c1ee Add a debug log message for updating the program status table in DB IDO
fixes #10379
2015-10-15 18:43:30 +02:00
Michael Friedrich 10c306673d Fix wrong connection log message for global zones
fixes #10377
2015-10-15 17:15:19 +02:00
Michael Friedrich 934fb64b9e Fix log message formatting for object version
refs #10355
2015-10-15 16:52:49 +02:00
Michael Friedrich 8ebf087772 Improve error message for socket errors in Livestatus
fixes #10079
2015-10-15 14:58:21 +02:00
Michael Friedrich 5852a003d0 Ensure that modified attributes work with clients with local config and no zone attribute
fixes #10371
2015-10-15 14:05:39 +02:00
Michael Friedrich a0631cd351 Fix wrong type for object version
refs #10355
2015-10-15 11:11:07 +02:00
Gunnar Beutner 4f647527fd Fix: ApiListener::SyncRelayMessage doesn't send message to all zone members
fixes #10365
2015-10-15 09:28:20 +02:00
Gunnar Beutner f89877cd28 Fix incorrect variable type in ApiListener::ConfigUpdateObjectAPIHandler
refs #10355
2015-10-15 09:26:58 +02:00
Gunnar Beutner 21a2986635 Avoid evaluating unnecessary filters
refs #10360
2015-10-14 16:52:01 +02:00
Gunnar Beutner f841daf680 Improve performance for object queries
fixes #10360
2015-10-14 16:08:23 +02:00
Gunnar Beutner 48d80e29a0 Don't look up joined objects when we don't need to
refs #10360
2015-10-14 15:36:59 +02:00
Gunnar Beutner 74aa5c1d6b Make sure that the 'version' attribute is updated when config attributes are changed
fixes #10355
2015-10-14 13:04:39 +02:00
Thomas Gelf 29188a4a10 Improve error handling in cidr_match function
refs #10354

Signed-off-by: Gunnar Beutner <gunnar@beutner.name>
2015-10-14 12:23:59 +02:00
Gunnar Beutner 06a0f182a5 Implement the cidr_match function
fixes #10354
2015-10-14 10:14:01 +02:00
Gunnar Beutner e92b7beeb4 Fix parsing performance data labels which contain '='
fixes #10254
2015-10-13 09:38:31 +02:00
Gunnar Beutner 2484016c54 Fix crash in RepositoryUtility::AddObject
fixes #10326
2015-10-13 09:15:06 +02:00
Gunnar Beutner 7c4fa22715 Fix support for host checks in CheckResultReader
fixes #10348
2015-10-13 08:56:12 +02:00
Gunnar Beutner d59054feee Add missing Start call for base class in CheckResultReader::Start
fixes #10349
2015-10-13 08:38:12 +02:00
Gunnar Beutner 9eb7cfa620 Add missing keywords in ConfigCompiler::GetKeywords
refs #9960
2015-10-07 06:09:55 -07:00
Gunnar Beutner 8136cda367 Implement the ignore_on_error keyword
fixes #9960
2015-10-05 12:44:11 +02:00
Michael Friedrich f0a5a0c23c Fix openssl certificate not after overflow on rhel5
refs #10266
2015-10-02 12:11:21 +02:00
Michael Friedrich c4209e6841 Fix wrong log message 2015-10-02 11:23:45 +02:00
Gunnar Beutner 5f98fd3e9a Update schema version in dbconnection.hpp
refs #9286
2015-10-01 17:13:33 +02:00
Gunnar Beutner 3bfc9a2406 Don't log messages we've already relayed to all relevant zones
fixes #10262
2015-10-01 14:53:28 +02:00
Gunnar Beutner 124d3f71f7 Change field type for ConfigObject::version to double
refs #10257
2015-10-01 04:49:35 +02:00
Gunnar Beutner 55616209ae Only update version when config attributes are changed
refs #10257
2015-10-01 04:45:50 +02:00
Michael Friedrich 9dcb33e8f4 Change object version to timestamps for diff updates on config sync
fixes #10257
2015-09-30 16:58:18 +02:00
Gunnar Beutner 359fb3f82b Fix formatting for floating-point values in ConfigWriter
fixes #10256
2015-09-30 16:43:32 +02:00
Gunnar Beutner c1892a2f30 Remove JsonRpcConnection::m_WriteQueue
refs #9976
2015-09-30 16:39:36 +02:00
Michael Friedrich 0529d51a85 Config sync does not set endpoint syncing and plays disconnect-sync ping-pong
fixes #10255
2015-09-30 16:14:04 +02:00
Michael Friedrich 657e749c9b Config sync shouldn't send updates for objects the client doesn't have access to
fixes #10249
2015-09-30 15:08:01 +02:00
Gunnar Beutner f779b20ec0 Properly encode URLs in Icinga Studio
fixes #10241
2015-09-30 14:02:18 +02:00
Gunnar Beutner f3fdcb0f6b Fix: /v1/objects/<type> returns an HTTP error when there are no objects of that type
fixes #10253
2015-09-30 13:26:19 +02:00
Gunnar Beutner 08ccb4e323 Build fix
refs #10245
2015-09-30 11:05:20 +02:00
Gunnar Beutner 254c076dd4 Fix incorrectly escaped arguments for CreateProcess
fixes #10245
2015-09-30 10:56:31 +02:00
Michael Friedrich 19e7524b31 Fix problem with non-existing objects in config sync updates
refs #9851
refs #9927
refs #9081
2015-09-30 10:04:37 +02:00
Gunnar Beutner 7e4953dd35 Improve log messages for HTTP requests
refs #9074
2015-09-30 08:41:09 +02:00
Michael Friedrich 00712f1902 Use a temporary file for modified-attributes.conf updates
fixes #10238
2015-09-29 18:40:04 +02:00
Michael Friedrich dfa2ac450c Re-add missing package and stage name in configstageshandler
refs #10194
2015-09-29 18:25:48 +02:00
Michael Friedrich 905de04293 Fix deadlock in ApiClient::~ApiClient()
refs #9976
2015-09-29 16:03:38 +02:00
Michael Friedrich bb3b724219 Fix object sync for modified attributes
refs #9851
refs #9927
refs #9081
2015-09-29 14:24:39 +02:00
Michael Friedrich 487ef513cf Remove dead code from old mod attrs in the cluster
refs #9851
2015-09-29 14:24:39 +02:00
Michael Friedrich 1813c0932c Remove dead code from old modified attributes
refs #9851
2015-09-29 14:24:39 +02:00
Michael Friedrich e5b26e60a5 Don't throw an exception when replaying the current replay log file
fixes #10239
2015-09-29 11:02:08 +02:00
Gunnar Beutner 0e40c3ee1d Fix deadlock in TlsStream::Close
fixes #10235
2015-09-29 10:31:16 +02:00
Gunnar Beutner 8dec953829 Fix incorrect variable in Url::ParsePort
refs #10224
2015-09-29 08:28:30 +02:00
Gunnar Beutner 143aa13118 Make Icinga Studio work with the latest API version
fixes #10224
2015-09-29 08:09:48 +02:00
Gunnar Beutner 6fb1b60c12 Fix: NULs don't work in string values
fixes #10234
2015-09-29 07:09:35 +02:00
Gunnar Beutner 8a2c7a055d Remove debug code
refs #9077
2015-09-29 06:48:16 +02:00
Michael Friedrich 76baeadb5b Fix wrong query type in modify object api request
refs #10212
2015-09-28 19:14:38 +02:00
Gunnar Beutner b40152f9fb Fix null pointer dereference in StatusTargetProvider::GetTargetByName
refs  #9088
2015-09-28 16:31:49 +02:00
Michael Friedrich f498ce39f3 Improve api error handling
refs #10194
2015-09-28 16:08:14 +02:00
Michael Friedrich a2058f0e55 Fix incorrect parameter name for status queries
refs #9088
2015-09-28 15:19:01 +02:00
Gunnar Beutner f091379177 Fix: PerfdataValue is not properly serialised in status queries
fixes #10211
2015-09-28 14:37:50 +02:00
Gunnar Beutner 425a1a0166 Implement API permissions
fixes #9088
2015-09-28 14:30:46 +02:00
Gunnar Beutner d24af1e639 Fix incorrect value for IdoMysqlConnection::m_AffectedRows
refs #10190
2015-09-28 13:19:42 +02:00
Gunnar Beutner 8a5d71a565 Move /v1/<type> to /v1/objects/<type>
refs #10212
2015-09-28 08:39:56 +02:00
Michael Friedrich 6549721ec6 Ensure that multiple object handler request methods still work
refs #10194
2015-09-27 15:27:08 +02:00
Michael Friedrich 717118fed4 Fix wrong log lag in cluster-zone check
Refactor the calculation into a generic function
which is also used inside the 2.4 status API.

fixes #8805
2015-09-25 14:24:45 +02:00
Jean-Marcel Flach 5ef4204d06 Improve API error handling and fix some whitespace
fixes #10194
2015-09-25 13:57:28 +02:00
Jean-Marcel Flach 15a46958f0 Rename statusqueryhandler to objectqueryhandler
fixes #10209
2015-09-24 17:38:44 +02:00
Jean-Marcel Flach d8eca3d0c2 Move /status/Collection to /status
fixes #10210
2015-09-24 15:26:57 +02:00
Michael Friedrich 8c997255a9 DB IDO: Fix modified custom attribute update query problems
fixes #10190
2015-09-24 11:45:44 +02:00
Gunnar Beutner 0c10d64094 Fix incorrect error messages for apply-for
fixes #10205
2015-09-24 08:30:03 +02:00
Michael Friedrich aa12a4e75c Add icinga, cluster, cluster-zone check information to the ApiListener status handler
fixes #8093
2015-09-23 18:09:46 +02:00
Jean-Marcel Flach 4ef9761fee Implement status api handler
Global statistics, features, etc.

fixes #10116
2015-09-23 16:59:07 +02:00
Gunnar Beutner e19a36c659 Fix parser error when using new-lines in dictionaries
fixes #10204
2015-09-23 16:37:21 +02:00
Michael Friedrich 84536da221 Implement global modified attributes for the IcingaApplication class
fixes #9859
2015-09-23 15:02:53 +02:00
Michael Friedrich 12cf90c67c Fix persisting and restoring modified attributes for custom attribute indexers
fixes #9935
fixes #9968
2015-09-23 13:29:30 +02:00
Gunnar Beutner ff59402a10 Remove unnecessary check in Value::IsObject
refs #10199
2015-09-23 10:48:49 +02:00
Gunnar Beutner afcb97303c Remove unnecessary MakeLiteral calls in SetExpression::DoEvaluate
fixes #10199
2015-09-23 10:37:13 +02:00
Gunnar Beutner c15c9cce5e Detect infinite recursion in user scripts
fixes #10198
2015-09-23 09:21:45 +02:00
Gunnar Beutner eeb01831c0 Implement the Array#reverse and String#reverse methods
fixes #10197
2015-09-23 09:06:15 +02:00
Gunnar Beutner b163e4a002 Make ConfigObject::{Get,Set}Field() methods public
fixes #10186
2015-09-23 08:33:18 +02:00
Gunnar Beutner 48bdd0ebf4 Fix: null + null should not be ""
fixes #10192
2015-09-22 13:13:38 +02:00
Gunnar Beutner 3bca951b81 Add missing handler for OnActiveChanged
refs #9098
2015-09-22 12:01:34 +02:00
Gunnar Beutner c5fe42e0b0 Update objects.cache when config is changed
fixes #9098
2015-09-22 11:56:27 +02:00
Gunnar Beutner ad6c8eaf7e Fix: String methods cannot be invoked on an empty string
fixes #10191
2015-09-22 11:24:00 +02:00
Gunnar Beutner 1a6b41787a Implement joins for status queries
fixes #10060
2015-09-22 09:45:23 +02:00
Michael Friedrich 95bcbec5b5 Implement support for restoring modified attributes
Also fix a glitch with ModifyAttribute and original_attributes
storage.

fixes #9935
2015-09-18 15:01:44 +02:00
Michael Friedrich f7b5aa33ce Fix a couple of wrong white spaces 2015-09-18 13:04:09 +02:00
Michael Friedrich 57179f3bdd Only sync objects actually belonging to a cluster zone
refs #9927
refs #9100
2015-09-18 12:49:38 +02:00
Michael Friedrich f2c3bffdd9 Sync cluster config before replaying the logs
If there were objects added at runtime (either through direct api
creation or by using the config file management api) the newly
created objects must be synced first, and then the stored historical
data should be synced.

refs #9927
refs #9100
2015-09-18 10:07:13 +02:00
Michael Friedrich 18d645e4ef Add zone attribute influencing cluster config sync for API objects
1) No zone defined. The object will only be synced in the local zone for HA purposes.
2) Zone is set to 'master'. Only nodes in the master zone will get this object and updates synced.
3) Zone is set to 'satellite'. Only nodes in the satellite zone, or in parent zones above will get this object and updates synced.
4) Zone is set to 'client'. Only nodes in the client zone, and in parent zones (satellite, master) will get object updates.

Furthermore this commit adds a bit more security measures for syncing object
config bottom-up which is clearly restricted at this time. Clients cannot
send their config to the top, but yet we only support the top-down thing we
also have with the cluster file config sync.

The initial sync will also take the zone relation model into account
and only allow object syncs only when the same conditions apply as written
above.

refs #9927
refs #9100
2015-09-17 14:20:44 +02:00
Michael Friedrich 0fd9d3406b Prevent object deletion on shutdown when checking !IsActive()
This is fairly ugly and sets an extension for the ConfigObjectUtility
delete handler to signal the OnActiveChanged handler inside the cluster
configsync to send a delete event to the other nodes.

refs #9927
2015-09-17 14:20:44 +02:00
Michael Friedrich 4955c28b0c Implement initial api object sync for newly connected endpoints
TODO: Figure out how to deal with Shutdown() deactivating and
therefore deleting all api created objects.

refs #9927
2015-09-17 14:20:44 +02:00
Michael Friedrich a6d8cea5c2 Update DB IDO on changed object version (create, update, delete)
refs #9927
2015-09-17 14:20:44 +02:00
Michael Friedrich b2715943c6 Config Sync: Properly modify attributes and object version
refs #9927
2015-09-17 14:20:44 +02:00
Michael Friedrich 81a0bc6f1b Implement deleting api created objects in the cluster
refs #9927
2015-09-17 14:20:44 +02:00
Michael Friedrich f9c058eca2 Implement object config sync permissions and modified attributes based on version
refs #9927
2015-09-17 14:20:43 +02:00
Gunnar Beutner 6fa58a520c Implement config object sync
Adds object version.

refs #9927
2015-09-17 14:20:43 +02:00
Tobias von der Krone da8613acf9 Add timestamp support for OpenTSDB
fixes #9183
2015-09-15 15:37:15 +02:00
Michael Friedrich fcf2f0ef5d Deprecate IcingaStatusWriter feature
fixes #8741
2015-09-14 10:36:06 +02:00
Michael Friedrich b10cb8a2e7 Implement a better Graphite tree schema
This changes the entire tree, but with the prefix "icinga2"
not to conflict with existing installations. Includes
enable_legacy_mode and detailed documentation.

fixes #9461
fixes #8149
2015-09-06 11:10:49 +02:00
Michael Friedrich 3403765900 Use the command_endpoint name as check_source value if defined
fixes #9218
2015-09-05 15:18:10 +02:00
Michael Friedrich fa6c0fe173 Fix string escape problem with PostgreSQL >= 9.1 and standard_conforming_strings=on
fixes #9244
2015-09-05 14:08:35 +02:00
Jean Flach 6571ffc2c8 Update url parser
fixes #10039
2015-09-04 14:40:27 +02:00
Michael Friedrich 50cd694142 Fix wrong calculation for host compat state UNREACHABLE
fixes #10058
2015-09-04 13:24:41 +02:00
Michael Friedrich 9a2ae6e58f Fix missing zero padding for generated CA serial
fixes #10074
2015-09-03 17:12:01 +02:00
Gunnar Beutner 35acba7dc1 Remove default WQ limits
refs #10002
2015-09-02 09:16:20 +02:00
Gunnar Beutner 5c77e6eafe Fix deadlock in ApiListener::RelayMessage
fixes #10002
2015-09-02 07:46:30 +02:00
Michael Friedrich da83bae660 Rename config/modules to config/packages
fixes #9953
2015-09-01 20:09:04 +02:00
Gunnar Beutner c37a23ccba Implement the Icinga Studio application
fixes #10042
2015-08-31 07:50:01 +02:00
Paul Richards 9b73205481 Build fix for the demo module
fixes #10041

Signed-off-by: Michael Friedrich <michael.friedrich@gmail.com>
2015-08-30 19:04:26 +02:00
Gunnar Beutner 6705853e33 Add plural_name field to /v1/types
fixes #10038
2015-08-29 12:05:44 +02:00
Michael Friedrich ce99dce3cb Remove unused variable
fixes #10034
refs #9872
2015-08-28 17:40:18 +02:00
Gunnar Beutner 9d9a7ca73d Fix filtering by name
fixes #10027
2015-08-28 10:52:59 +02:00
Gunnar Beutner d7a21c2361 Fix incorrect HTTP encoding
refs #10024
2015-08-28 10:03:26 +02:00
Gunnar Beutner 49fd5b582d Fix: HttpHandler is calling HttpResponse::Finish twice for 404s
fixes #10024
2015-08-28 09:49:31 +02:00
Jean Flach f1a1dfb26e Update use of String::Trim()
fixes #9704
2015-08-27 18:06:20 +02:00
Jean Flach 5bbc8cacbd Add String ToLower, ToUpper, change Trim
fixes #9704 #9944
2015-08-27 17:18:21 +02:00
Gunnar Beutner f2a055c85a Use an AST node for the 'library' keyword
fixes #10017
2015-08-27 14:50:08 +02:00
Gunnar Beutner 63a1ff77c3 Implement the resolve_arguments function
fixes #10006
2015-08-27 09:02:21 +02:00
Gunnar Beutner 6ef9d3c4db Missing macros in nested macro() calls should not cause the outer macro resolution to fail
fixes #10003
2015-08-27 09:02:21 +02:00
Gunnar Beutner 373b88df33 Implement the escape_shell_arg and escape_shell_cmd functions
fixes #10004
2015-08-27 09:02:21 +02:00
Jean Flach 73d8ffb462 Fix range() with negative increments
fixes #9999
2015-08-26 16:38:26 +02:00
Jean Flach 01ced1549a Implement all actions except modified attributes
refs #9080 #9979
2015-08-26 13:53:17 +02:00
Gunnar Beutner 3afe9a35d8 Implement the 'name' field for types
refs #9076
2015-08-26 13:05:09 +02:00