Commit Graph

3693 Commits

Author SHA1 Message Date
Gunnar Beutner ba14c6e7ff Build fix for Windows
refs 
2016-08-31 13:37:13 +02:00
Gunnar Beutner 54f0cb2c2c Add another rvalue constructor to the String class
refs 
2016-08-31 13:27:59 +02:00
Gunnar Beutner 5127a193b4 Avoid unnecessary copies when using Dictionary::Pair in loops
refs 
2016-08-30 23:01:54 +02:00
Gunnar Beutner 8c50c6f91f Add context traces to most exceptions
fixes 
2016-08-30 20:46:23 +02:00
Gunnar Beutner 68dceaab06 Replace boost::exception_ptr with std::exception_ptr
refs 
2016-08-30 20:46:23 +02:00
Gunnar Beutner dca185a636 Implement support for libcxxabi
refs 
2016-08-30 20:46:23 +02:00
Gunnar Beutner 3d1490529f Fix race condition for concurrent_checks
fixes 
2016-08-29 14:12:29 +02:00
Gunnar Beutner 96ee214c57 Add rvalue constructor for the Task class
refs 
2016-08-29 09:00:12 +02:00
Gunnar Beutner 489269e2fa Fix incorrect debug hints for nested dictionary expressions
fixes 
2016-08-29 08:46:29 +02:00
Gunnar Beutner 32e6da1c60 Speed up item lookups for ConfigItem::GetDefaultTemplates
refs 
2016-08-29 08:40:46 +02:00
Gunnar Beutner f12b52f465 Use lambdas in the ConfigItem class
refs 
2016-08-29 08:16:33 +02:00
Gunnar Beutner 11e1cc9939 Remove unnecessary ScriptFrame variable
refs 
2016-08-29 05:54:07 +02:00
Gunnar Beutner 903db81fe0 Make sure that libmethods is automatically loaded even when not using the ITL
fixes 
2016-08-28 17:03:08 +02:00
Gunnar Beutner 2ce8a4d4cc Add missing initializers for the ConfigItemBuilder class
refs 
2016-08-28 14:12:07 +02:00
Gunnar Beutner e5af5b5dd3 Use raw string literals in mkembedconfig
fixes 
2016-08-28 11:01:45 +02:00
Gunnar Beutner 69bb90403d Add missing default import AST node for the application object
refs 
2016-08-28 11:00:27 +02:00
Gunnar Beutner 4876a78ab5 Remove unnecessary imports from unit test config
refs 
2016-08-28 10:41:46 +02:00
Gunnar Beutner 78cd56e277 Implement support for default templates
fixes 
2016-08-28 10:27:43 +02:00
Gunnar Beutner ed72112d4b Remove even more unnecessary copies
refs 
2016-08-27 20:37:25 +02:00
Gunnar Beutner ef50c57ed0 Make VS 2013 happy
refs 
2016-08-27 20:07:48 +02:00
Gunnar Beutner e8b0797ec4 Use 'auto' keyword for iterator declarations (part 2)
refs 
2016-08-27 19:56:12 +02:00
Gunnar Beutner 602643b93d Provide location information for objects and templates in the API
fixes 
2016-08-27 19:25:38 +02:00
Gunnar Beutner eafe4c578d Avoid unnecessary copies for the DebugHint class
refs 
2016-08-27 18:43:14 +02:00
Gunnar Beutner f1cac2f20a Fix compatibility with boost <= 1.53
refs 
2016-08-27 12:43:56 +02:00
Gunnar Beutner 8f2477db46 Fix incorrect variable type in the FilterArrayToInt function
refs 
2016-08-27 12:23:09 +02:00
Gunnar Beutner 27a23fcff6 Avoid an unnecessary case in the Encode function
refs 
2016-08-27 12:20:54 +02:00
Gunnar Beutner 00eec13338 Avoid unnecessary string copies in the JSON encoder
refs 
2016-08-27 11:47:36 +02:00
Gunnar Beutner 170c3624e3 Use 'default' for move constructors
refs 
2016-08-27 11:39:08 +02:00
Gunnar Beutner 7c273d7748 Add another rvalue constructor for the String class
refs 
2016-08-27 11:00:04 +02:00
Gunnar Beutner 6e384f81a0 Remove unused #includes
refs 
2016-08-27 10:59:52 +02:00
Gunnar Beutner 4dbc07e2bc Improve support for MySQL >=5.7
fixes 
2016-08-27 10:20:59 +02:00
Gunnar Beutner b5b09216c6 Use lambda functions for INITIALIZE_ONCE
fixes 
2016-08-27 09:48:36 +02:00
Gunnar Beutner 5058c5d75b Use 'auto' for iterator declarations
fixes 
2016-08-27 08:37:19 +02:00
Gunnar Beutner 56ba6089d0 Add rvalue support for the Array and Dictionary classes
refs 
2016-08-27 07:42:28 +02:00
Gunnar Beutner 7194b36d3e Avoid unnecessary string copies for LiteralExpression objects
refs 
2016-08-26 18:11:56 +02:00
Gunnar Beutner c1a58446af Add another rvalue constructor for the Value class
refs 
2016-08-26 18:11:28 +02:00
Gunnar Beutner dac0ff9343 Improve config validation for arrays of object names
fixes 
2016-08-26 10:36:53 +02:00
Gunnar Beutner 4f46e59af3 Implement an rvalue constructor for the String and Value classes
fixes 
2016-08-26 09:11:36 +02:00
Gunnar Beutner 49a130242c Add missing #include in loader.cpp
refs 
2016-08-25 20:59:22 +02:00
Gunnar Beutner 1236495dd3 Implement the --file and --syntax-only options for "icinga2 console"
fixes 
fixes 
2016-08-25 19:14:54 +02:00
Gunnar Beutner 30762e5330 Set versions for all internal libraries
fixes 
2016-08-25 17:56:18 +02:00
Gunnar Beutner 092f2ee099 Add missing initializer for WorkQueue::m_NextTaskID
fixes 
2016-08-25 11:57:00 +02:00
Gunnar Beutner ce7b6e4f87 Remove unused method: ApplyRule::DiscardRules
fixes 
2016-08-25 10:21:14 +02:00
Gunnar Beutner 225bb8029a Fix incorrect hash size for User objects
fixes 
2016-08-25 07:37:41 +02:00
Gunnar Beutner 8ed21fcdad Fix compiler warning in dbg_eval
refs 
2016-08-25 06:46:24 +02:00
Gunnar Beutner 288413f046 Replace BOOST_FOREACH with range-based for loops
fixes 
2016-08-25 06:46:17 +02:00
Gunnar Beutner 78c249b96b Fix compiler warnings in DB IDO
refs 
2016-08-25 05:00:46 +02:00
Gunnar Beutner 429d11daa8 Fix compiler warnings
fixes 
2016-08-24 20:33:34 +02:00
Gunnar Beutner ae1ab5f865 Implement unit tests for state changes
fixes 
2016-08-24 19:45:52 +02:00
Gunnar Beutner c981426cfb Fix missing IDO updates for groups
fixes 
2016-08-24 12:22:09 +02:00
Gunnar Beutner deb938d412 Fix incorrect notifications for soft recoveries
fixes 
2016-08-24 12:22:08 +02:00
Gunnar Beutner 82b6ef4301 Don't update TimePeriod ranges for inactive objects
fixes 
2016-08-23 15:01:40 +02:00
Gunnar Beutner 218e780a44 Avoid unnecessary string copies
fixes 
2016-08-23 15:01:40 +02:00
Gunnar Beutner 43a4acd5a2 Remove deprecated functions
fixes 
2016-08-23 15:01:40 +02:00
Michael Friedrich cd1b2cdddd Fix that recovery notifications are sent in SOFT NOT-OK states
fixes 
2016-08-23 14:58:24 +02:00
Gunnar Beutner f4dce0fe72 Fix crash in JsonRpcConnection::MessageHandlerWrapper
fixes 
2016-08-22 17:42:59 +02:00
Michael Friedrich b8d3bcad6a Cluster: Fix notified users for NotificationSentToAllUsers event
refs 
refs 
2016-08-22 10:47:09 +02:00
Gunnar Beutner b42bfc822b Fix crash in HttpServerConnection::ProcessMessageAsync
fixes 
2016-08-19 20:36:27 +02:00
Gunnar Beutner aeaca5e803 Revert "Fix incorrect detection of the 'Concurrency' variable"
This reverts commit 585f0537d2.

refs 
2016-08-19 11:58:52 +02:00
Gunnar Beutner b5637a2d16 Fix memory leak for the 'use' keyword
fixes 
2016-08-19 09:17:40 +02:00
Gunnar Beutner 8e5961f217 Fix missing permissions and update the documentation
fixes 
2016-08-18 19:00:14 +02:00
Gunnar Beutner 27e6db6af6 Remove some unused #includes
fixes 
2016-08-18 15:46:01 +02:00
Gunnar Beutner 487d2a9907 Make "clr-check-command" template usable on *nix
fixes 
2016-08-18 10:27:41 +02:00
Gunnar Beutner 730364b600 Fix incorrect certificate validation error message
fixes 
2016-08-18 10:23:13 +02:00
Gunnar Beutner 62a6d5667d Fix: IDO marks objects as inactive on shutdown
fixes 
2016-08-17 19:24:22 +02:00
Michael Friedrich e5566a6bd8 API: Fix missing attributes for DowntimeTriggered event
fixes 
2016-08-17 16:57:22 +02:00
Rune Darrud d1dc1188e1 Remove obsolete reference to serial.txt
fixes 

Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
2016-08-17 16:19:24 +02:00
Gunnar Beutner 4c54cddec8 Fix problem with duplicate INSERTs for the same key columns
fixes 
fixes 
2016-08-17 13:35:10 +02:00
Gunnar Beutner b26b3a4f65 Add missing lock
refs 
2016-08-17 09:20:05 +02:00
Gunnar Beutner 7fcf8ece72 Remove unnecessary dictionary lookups in the DebugHint class
refs 
2016-08-17 09:20:05 +02:00
Gunnar Beutner bb7fe3334a Fix incorrect customvariablestatus query
fixes 
2016-08-17 09:20:05 +02:00
Gunnar Beutner 585f0537d2 Fix incorrect detection of the 'Concurrency' variable
fixes 
2016-08-17 09:20:05 +02:00
Michael Friedrich 87bc291a55 Fix that HA enabled objects are started before config validation has finished
fixes 
2016-08-17 09:19:58 +02:00
Rune Darrud 5c0b3c58bd Do not escape backslashes and separators twice
fixes 

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
2016-08-17 06:10:41 +02:00
Gunnar Beutner 162e31b083 Remove unnecessary Dictionary::Contains calls
fixes 
2016-08-16 22:03:42 +02:00
Michael Friedrich 520be9513b API: Fix that schedule-downtime action requires duration for fixed=true
fixes 
2016-08-16 17:09:25 +02:00
Gunnar Beutner ec87b9e795 Use hash-based serial numbers for new certificates
fixes 
2016-08-16 15:03:01 +02:00
Gunnar Beutner 81974adf65 Improve performance for Endpoint config validation
fixes 
2016-08-16 13:55:37 +02:00
Michael Friedrich 832b5bed2a Remove debug output in NotificationComponent
refs 
2016-08-16 13:48:09 +02:00
Gunnar Beutner 2d551db9d8 Remove the ConfigTypeIterator class
refs 
2016-08-16 13:26:24 +02:00
Gunnar Beutner b7a1b58069 Improve performance for type lookups
fixes 
2016-08-16 11:02:33 +02:00
Michael Friedrich a34e01d0bb Fix NotificationSentToAllUsers cluster event
refs 
2016-08-16 09:30:10 +02:00
Michael Friedrich d909c0945c Add an explicit flag for disabling reminder notifications
refs 
2016-08-15 18:32:51 +02:00
Michael Friedrich 17544d7b54 Fix: ClusterEvents::NotificationSentAllUsersAPIHandler() does not set notified_users
fixes 
2016-08-15 17:26:01 +02:00
Michael Friedrich 1ec7d366a7 Fix ITL methods templates for timeperiods
fixes 
2016-08-15 16:16:23 +02:00
Michael Friedrich d341783a51 API: Implement 'generate-ticket' action and update distributed monitoring docs
fixes 
2016-08-15 15:19:28 +02:00
Gunnar Beutner 2e8d3d3934 Implement support for incremental IDO updates
fixes 
2016-08-15 14:43:11 +02:00
Gunnar Beutner ebaf239d3b Replace GetType()->GetName() calls with GetReflectionType()->GetName()
fixes 
2016-08-15 14:42:03 +02:00
Gunnar Beutner 8ced75b7d2 Fix the load order for Host/Service vs. Endpoint/Zone
refs 
2016-08-14 23:04:55 +02:00
Gunnar Beutner 980ba42825 Remove unused code in the IDO classes
fixes 
2016-08-14 22:22:18 +02:00
Gunnar Beutner 39ded04e1a Improve validation for the command_endpoint attribute
fixes 
2016-08-14 22:11:29 +02:00
Gunnar Beutner 005e0f532f Improve HA support for the IDO check task
fixes 
2016-08-14 20:17:14 +02:00
Gunnar Beutner c6e5f3dcb8 Fix $ido_name$ macro when using the IDO check type with command_endpoint
fixes 
2016-08-14 19:30:20 +02:00
Gunnar Beutner 6af9e61e9b Implement comparison operators for the Array class
fixes 
2016-08-14 17:21:47 +02:00
Gunnar Beutner fda032c0c4 Fix incorrect return values for some of the CompatUtility methods
fixes 
2016-08-14 17:06:50 +02:00
Rune Darrud 16d1f1893e Fix typo in mysql schema
fixes 
2016-08-14 13:03:49 +02:00
Michael Friedrich 186fcb3724 Fix log message for WriteCert()
refs 
2016-08-14 09:28:55 +02:00
Michael Friedrich a83d81a71d Fix that pki sign-csr is not logging the certificate file location
fixes 
2016-08-14 09:22:18 +02:00
Gunnar Beutner ed53366490 Avoid duplicate IDO config updates at startup
fixes 
2016-08-13 23:31:22 +02:00
Gunnar Beutner 9f8cb8dd36 Clean up the code a bit
refs 
2016-08-13 21:43:59 +02:00
Michael Friedrich 8f03adf76f Remove Downtime objects w/o reference to ScheduledDowntime objects
fixes 
2016-08-13 15:18:50 +02:00
Gunnar Beutner afc1b9bdc5 Move type variables into the 'Types' namespace
refs 
2016-08-12 17:05:19 +02:00
Gunnar Beutner 99f944ac28 Remove extraneous space in a log message
refs 
2016-08-12 16:38:05 +02:00
Gunnar Beutner 91577713fd Fix incorrect function name for deprecated functions
refs 
2016-08-12 15:41:03 +02:00
Gunnar Beutner b74014fa5e Fix auto-completion suggestions for "icinga2 console"
refs 
2016-08-12 15:36:47 +02:00
Gunnar Beutner 12ea2a6445 Implement the System#sleep function
fixes 
2016-08-12 15:22:10 +02:00
Gunnar Beutner 491acb62ea Fix crash in ScriptFrame::AddImport
refs 
2016-08-12 15:22:10 +02:00
Michael Friedrich e28f30a727 Enhance log messages for {,reminder} notifications
refs 
2016-08-12 14:49:29 +02:00
Gunnar Beutner c6a753b67e Make sure base classes are registered in the right order
refs 
2016-08-12 14:18:59 +02:00
Gunnar Beutner 31f816562f Add namespace qualifier for some assert() calls
refs 
2016-08-12 13:44:51 +02:00
Gunnar Beutner 24431b3dab Register deprecated methods in the 'Deprecated' namespace
refs 
2016-08-12 13:42:22 +02:00
Gunnar Beutner 419500e55e Fix 'use' keyword for templates
fixes 
2016-08-12 13:32:13 +02:00
Gunnar Beutner 2a40a71ffa Change scoping mechanism for the __using keyword
refs 
2016-08-12 13:14:10 +02:00
Gunnar Beutner 3980cf04a0 Fix exception with __using
refs 
2016-08-12 12:05:02 +02:00
Gunnar Beutner 9f67b185b8 Make sure all constructors properly initialize the ScriptFrame object
refs 
2016-08-12 11:42:59 +02:00
Gunnar Beutner c5a170a972 Implement support for namespaces
fixes 
2016-08-12 11:32:16 +02:00
Gunnar Beutner 76ed38fbfe Implement support for inspecting variables with LLDB/GDB
fixes 
2016-08-12 11:00:19 +02:00
Michael Friedrich d84872f075 DB IDO: Really do not clear downtimes on checkable upsert
refs 
refs 
2016-08-11 17:43:39 +02:00
Michael Friedrich f5d5eaf344 Add log message if notifications are forced (i.e. filters are not checked)
fixes 
2016-08-11 16:23:58 +02:00
Michael Friedrich 41094489b6 DB IDO: Fixed downtime start does not update actual_start_time
fixes 
2016-08-11 12:10:27 +02:00
Gunnar Beutner 132ee6c558 Use InterlockedIncrement instead of a mutex in CreatePipeOverlapped
refs 
2016-08-11 09:48:01 +02:00
Gunnar Beutner f0beeba354 Fix missing names for user-defined functions
refs 
2016-08-11 09:08:33 +02:00
Michael Friedrich 8389d01998 Fix flexible downtimes expiry time and removal
fixes 
2016-08-10 17:15:27 +02:00
Gunnar Beutner e09fb88cae Make sure functions are registered with the correct prefix
refs 
2016-08-10 16:33:17 +02:00
Michael Friedrich 42818ab758 Fix downtime notification events and missing author/comment
fixes 
fixes 
2016-08-10 16:04:37 +02:00
Gunnar Beutner 54bbaf9f7d Implement support for marking functions as deprecated
fixes 
2016-08-10 15:48:05 +02:00
Timo Buhrmester 148b4da285 Don't violate POSIX by ensuring that the argument to usleep(3) is less than 1000000
fixes 

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
2016-08-10 12:29:52 +02:00
Gunnar Beutner 37bd5ad800 Fix race condition in CreatePipeOverlapped
fixes 
2016-08-10 12:12:56 +02:00
Gunnar Beutner 39bde8078c Disallow casting "" to an Object
fixes 
2016-08-10 11:14:33 +02:00
Gunnar Beutner e8ae1dc4a6 Include compiler name/version and build host name in --version
fixes 
2016-08-10 08:09:44 +02:00
Gunnar Beutner dc06209e4a Move internal script functions into the 'Internal' namespace
fixes 
2016-08-10 06:55:44 +02:00
Gunnar Beutner 43c2ec31ef Windows build fix
fixes 
2016-08-09 15:41:27 +02:00
Gunnar Beutner f3bb628d6e Improve logging for the WorkQueue class
fixes 
2016-08-09 12:39:07 +02:00
Gunnar Beutner 4c7e2994a7 Handle I/O errors while writing the Icinga state file more gracefully
fixes 
2016-08-09 10:59:08 +02:00
Gunnar Beutner ff293661fc Rename/Remove experimental script functions
fixes 
2016-08-09 10:43:55 +02:00
Marius Sturm 451cd73749 GelfWriter: Use raw CheckResult output for full_message attribute
fixes 

Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
2016-08-09 09:51:17 +02:00
Gunnar Beutner 9f425cdcaf Fix building Icinga with -fvisibility=hidden
fixes 
2016-08-09 09:00:19 +02:00
Gunnar Beutner 26d048d6c3 Add version info in /v1
fixes 
2016-08-09 08:48:18 +02:00
Gunnar Beutner 231fd8d38b Build fix for CentOS 5
refs 
2016-08-08 15:27:16 +02:00
Gunnar Beutner 1beef64dc4 Fix crash in Checkable::ProcessCheckResult when cr is NULL
refs 
2016-08-08 14:17:44 +02:00
Gunnar Beutner c7602a0f34 Implement process_check_result script method for the Checkable class
fixes 
2016-08-08 14:14:45 +02:00
Gunnar Beutner 8deeb73bb8 Register a new script frame in Function::Invoke
fixes 
2016-08-08 14:12:08 +02:00
Gunnar Beutner 1cd8a25ab2 Add the "exception" check command
refs 
2016-08-08 12:51:20 +02:00
Gunnar Beutner 597dc0dea2 Fix incorrect behavior for max_check_attempts
fixes 
2016-08-08 11:02:08 +02:00
Gunnar Beutner 26821d1a79 Don't add empty lines to libedit's history
refs 
2016-08-08 08:01:52 +02:00
Gunnar Beutner 46f8c7eb59 Remove temporary icinga2.debug file in case the config validation fails
fixes 
2016-08-05 09:15:17 +02:00
Gunnar Beutner d0658c465b Fix incorrect parameter name for NotificationSentAllUsersHandler
fixes 
2016-08-05 06:57:50 +02:00
Michael Friedrich 43a177fb16 Fix that notifications with empty times.{begin,end} are not sent
fixes 
2016-08-04 17:27:35 +02:00
Michael Friedrich 3f89a6dd09 Disable immediate hard state for first check result
fixes 
2016-08-04 16:16:58 +02:00
Gunnar Beutner 905380b436 Fix duplicate notifications on HA failover
fixes 
2016-08-04 10:12:55 +02:00
Gunnar Beutner bd3660fe5a Build fix for Windows
refs 
2016-08-04 06:34:47 +02:00
Michael Friedrich 34655d77d3 Ensure to send recovery notifications if the was a problem notification before a downtime
fixes 
2016-08-03 18:28:09 +02:00
Michael Friedrich 83f07c7ee2 Add the notification type into the log message
fixes 
2016-08-03 17:32:55 +02:00
Michael Friedrich 00f05a8e7e DB IDO: Do not try to delete downtimes when using the session_token
Missed it after modifying the comments.

refs 
refs 
2016-08-03 16:15:22 +02:00
Uwe Ebel b2ac05ad7d Make the minimum TLS protocol version configurable
The ApiListener accepts all TLS versions that the underlying
OpenSSL library supports. This patch give the ability to restrict
the connection to a minimum TLS version.

fixes 

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
2016-08-03 07:46:50 +02:00
Michael Friedrich 5498dc5e4f Fix that the first notification interval is incorrect
fixes 
2016-08-02 18:41:01 +02:00
Conrad Clement 3f0b6ec003 Optimize two ObjectLocks into one in Notification::BeginExecuteNotification method
object is locked twice to update values of
NotificationNumber, LastNotification and LastProblemNotification.
LastNotificaiton is updated inside each ObjectLock
merge two ObjectLocks into one and remove duplicate update

fixes 

Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
2016-08-02 18:36:29 +02:00
Michael Friedrich 1ff6939f90 Fix missing MySQL session_token changes
refs 
refs 
2016-08-02 15:05:21 +02:00
Michael Friedrich cd5c9366cf DB IDO: Use upsert and session token for comment/downtime updates
refs 
fixes 
2016-08-02 14:37:16 +02:00
Michael Friedrich 53930e321c DB IDO: Ensure that queries are not executed if categories don't match
refs 
refs 
2016-08-02 14:27:20 +02:00
Michael Friedrich b7da28b176 Enhance TLS handshake error messages with connection information
fixes 
2016-08-02 12:14:03 +02:00
Michael Friedrich 73417275f6 Fix incorrect index drop in pgsql.sql
refs 
2016-08-02 11:05:48 +02:00
Michael Friedrich 7d78c53dd8 Fix incorrect session_token index for PostgreSQL
refs 
2016-08-01 15:04:47 +02:00
Markus Frosch d0183edc51 Fix build with OpenSSL 1.1
error: cannot convert ‘const boost::shared_ptr<x509_st>’ to ‘X509* {aka
x509_st*}’ for argument ‘1’ to ‘ASN1_TIME* X509_get_notBefore(X509*)’

refs 
2016-08-01 09:54:51 +02:00
Michael Friedrich 32b37f0db9 Fix missing session_token column
refs 
2016-08-01 09:37:10 +02:00
Gunnar Beutner 546bdbcf6a 'Sandboxed' property isn't properly propagated to child frames
refs 
2016-07-29 14:11:52 +02:00
Gunnar Beutner aaa4878017 Don't write empty lines to the history file
refs 
2016-07-29 13:55:07 +02:00
Gunnar Beutner a02d7d7502 Implement history support for 'icinga2 console'
fixes 
2016-07-29 13:45:16 +02:00
Gunnar Beutner ee75094128 Change how Array#reduce works
refs 
2016-07-29 11:09:46 +02:00
Gunnar Beutner a3815e4efd Add map/reduce and filter functionality for the Array class
fixes 
2016-07-29 10:48:15 +02:00
Gunnar Beutner 0d02b01c02 Use application start-up time for the IDO session token
fixes 
2016-07-29 08:40:10 +02:00
Gunnar Beutner 92c28548d1 Remove obsolete debug log message
fixes 
2016-07-29 07:09:01 +02:00
Simon Murray 84ea0065b2 Fix InfluxdbWriter Trailing Backslash
Backslashes escape spaces or commas (and evidently equals), given tags are
separated by commas, tag keys and values are separated by equals and tags
are separated from fields by a space we need to take action when these end
in a backslash e.g. 'C:\'.  Also discovered a bug whereby the metric tag was
missing out on escaping.

fixes 

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
2016-07-29 06:51:33 +02:00
Michael Friedrich dcfda534b1 Deprecation warning should include object type and name
fixes 
2016-07-28 17:43:50 +02:00
Michael Friedrich d7903ba800 Enhance client disconnect message for "No data received on new API connection."
fixes 

Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
2016-07-28 17:40:40 +02:00
Michael Friedrich 077dbe1db6 Fix that reminder notifications ignore HA mode
fixes 
2016-07-28 17:39:52 +02:00
Gunnar Beutner 21cebe97a1 CheckerComponent sometimes fails to schedule checks in time
fixes 
2016-07-28 13:51:08 +02:00
Rune Darrud 54eb9540b1 Fix min/max execution_time
fixes 

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
2016-07-26 09:56:21 +02:00
Rune Darrud 730d959374 Set min_latency and min_execution_time to 0 when there have been no checkresults processed
fixes 

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
2016-07-26 09:54:08 +02:00
Gunnar Beutner 55a3dc22bf Log a warning if there are more than 2 zone endpoint members
fixes 
2016-07-26 08:10:47 +02:00
Michael Friedrich ce3d7ab973 DB IDO: Do not clear {host,service,contact}group_members tables on restart
fixes 
2016-07-25 17:10:27 +02:00
Gunnar Beutner 22bb1f406a Fix URL encoding for '&'
fixes 
2016-07-25 10:54:17 +02:00
Gunnar Beutner cdda3bad8c Include client IP address and port in HTTP requests
fixes 
2016-07-25 09:43:13 +02:00
Gunnar Beutner 45dd027101 Include IP address and port in the "New connection" log message
fixes 
2016-07-25 09:31:38 +02:00
Stephan Tesch 431c110056 Improve error reporting for the client certificate check
Until now, client certificates that have failed verification were reported as not being signed by the CA. That is not true for all cases. This patch adds an explanation in the debug log why verification failed.

fixes 
2016-07-25 09:22:35 +02:00
Gunnar Beutner caf2812f0d Implement the __ptr function
fixes 
2016-07-22 09:43:59 +02:00
Michael Friedrich 2d53cdb845 Improve log message for connecting nodes without configured Endpoint object
fixes 
2016-07-21 13:48:00 +02:00
Gunnar Beutner e9605168a1 Increase reconnection timer interval for cluster connections
fixes 
2016-07-21 12:27:18 +02:00
Michael Friedrich e712d6ffe7 Fix error message for specified ciphers
refs 
2016-07-19 20:13:34 +02:00
Michael Friedrich 743a726752 state_filters_real shouldn't be visible in the API
fixes 
2016-07-19 20:09:39 +02:00
Gunnar Beutner 9075de67b1 Fix message routing for command_endpoint checks in satellite zones with >2 instances
refs 
2016-07-19 18:32:01 +02:00
Michael Friedrich 3d06df96bc Fix duplicate CheckResult messages for command_endpoint
fixes 
2016-07-19 17:36:14 +02:00
Uwe Ebel 1ca8b293cb Make the cipher list configurable for TLS streams
fixes 

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
2016-07-18 13:40:00 +02:00
Gunnar Beutner 959e2501aa Avoid duplicate entries in the icinga_objects table for commands
refs 
2016-07-15 09:40:39 +02:00
Gunnar Beutner 1bd235b9fb Improve IDO performance
refs 
2016-07-13 14:44:53 +02:00
Gunnar Beutner 60c52f2109 Fix crash on Windows
fixes 
2016-07-12 15:33:44 +02:00
Gunnar Beutner ea57f0045e Fix deadlock in DbObject::SendVars{Config,Status}Update
fixes 
fixes 
2016-07-12 11:44:36 +02:00
Michael Friedrich ca42b4658a DB IDO: Change alias column to varchar(255) in MySQL
fixes 
2016-07-07 18:48:09 +02:00
Michael Friedrich 72facb1be0 DB IDO: Log a deprecation warning for categories
refs 
2016-07-07 15:44:31 +02:00
Michael Friedrich 124c80beab Require DB IDO v1.14.1 for 2.5.0
fixes 
2016-07-07 12:27:56 +02:00
Michael Friedrich a0a5989181 Add missing index on statehistory table for DB IDO cleanup
fixes 
2016-07-06 12:17:41 +02:00
Michael Friedrich f87f20e9ec DB IDO: Do not populate logentries table by default
Not required by Icinga Web 2 and therefore obsolete as default.

fixes 
2016-07-06 11:52:20 +02:00
Michael Friedrich 915ebe17cd ConfigCompiler should not log included files by default
fixes 
2016-07-05 15:43:48 +02:00
Michael Friedrich 5836b5b868 Fix: include_recursive should gracefully handle inaccessible files
fixes 
2016-07-05 15:40:49 +02:00
Michael Friedrich 9b873d60c2 Ensure to clear the SSL error queue before calling SSL_{read,write,do_handshake}
fixes 
2016-07-05 15:25:02 +02:00
Michael Friedrich c73e4d3328 Fix Downtime validation function signature
refs 
2016-07-05 13:17:18 +02:00
Michael Friedrich 85afec8952 Fix setsockopt() error on Windows
refs 
2016-07-05 13:16:14 +02:00
Simon Murray c6add53152 Fix InfluxDB Writer Key Escaping
The escaping wasn't being performed on measuerments, keys or tag values.  The
escape function was returning the input and not the modified ouput, so this
has been fixed

refs 

Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
2016-06-27 12:07:07 +02:00
Gunnar Beutner 6de6ea5e42 Build fix for OpenSSL 1.1.0
fixes 
2016-06-27 08:28:22 +02:00
Michael Friedrich c688a94f8a API: Add missing downtime_depth attribute
fixes 
2016-06-25 17:32:12 +02:00
Michael Friedrich ab4ba18238 Allow strings in Dependency states filter
refs 
2016-06-24 14:17:24 +02:00
Michael Friedrich 1451a0e5ad Add lag thresholds to cluster-zone check
fixes 
2016-06-24 10:33:04 +02:00
Michael Friedrich 091274e417 Change DB IDO 'categories' attribute to Array notation
Example:
    categories = [ "DbCatProgramStatus", "DbCatState" ]

The old method with constants and OR is still supported but deprecated.

refs 
fixes 
2016-06-23 14:55:01 +02:00
Michael Friedrich 14fdb794e2 Allow strings in state and type filters (config, API)
fixes 
2016-06-23 14:52:45 +02:00
Michael Friedrich 7077ca1a53 Add acknowledgement type to Graphite, InfluxDB, OpenTSDB metadata
fixes 
2016-06-23 13:04:23 +02:00
Gunnar Beutner 906ab613f3 Fix crash when using include_recursive in an object definition
fixes 
2016-06-22 17:01:36 +02:00
Michael Friedrich 7f56a04dd5 DB IDO: Add missing indexes for icinga_endpoints* and icinga_zones* tables
fixes 
2016-06-22 12:56:24 +02:00
Gunnar Beutner 428850a6b3 Fix: ConfigWriter::EmitScope incorrectly quotes dictionary keys
fixes 
2016-06-22 12:35:47 +02:00
Michael Friedrich 067cb8d283 DB IDO: Fix overflow in current_notification_number column (MySQL)
fixes 
2016-06-22 12:13:49 +02:00
Simon Murray e3645aa2f7 Fix hanging API connections
There was a problem identified where an upstream API connection was found hanging waiting
for a TLS handshake to complete.  Seeingly the TCP connection was ESTABLISHED locally but
not cleanly terminated remotely.  The Socket events layer never triggered the TLS handshake
oddly.  This however enables TCP keep alive packets to detect broken connections, raising
EPOLLERR and breaking the deadlock condition so that the agent will attempt to reconnect
at a later time.

fixes 

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
2016-06-22 09:25:00 +02:00
Gunnar Beutner e3f1c1ec6f Make sure timestamps are formatted as integers in macro strings
refs 
2016-06-21 11:29:12 +02:00
Gunnar Beutner b5a38f6707 Fix compatibility issue with the $icinga.timet$ macro
fixes 
2016-06-21 08:23:31 +02:00
Michael Friedrich 409a385590 DB IDO: Ensure that delete queries for comments/downtimes are matching the index
fixes 
2016-06-20 17:38:01 +02:00
Michael Friedrich f10289aa71 DB IDO: Add missing object_id index for icinga_{scheduleddowntime,comments} tables
fixes 
refs 
2016-06-20 17:15:09 +02:00
Michael Friedrich f610e56a59 DB IDO: Fix missing schema version update in {mysql,pgsql}.sql
refs 
refs 
2016-06-20 16:17:06 +02:00
Michael Friedrich f4241ba185 DB IDO: Enhance ido check with schema info
fixes 
2016-06-17 12:43:05 +02:00
Michael Friedrich 6a46706668 DB IDO: Update schema version to 1.14.1
The least supported version is still 1.14.0
with the current changes.

refs 
refs 
2016-06-17 11:23:30 +02:00
Lee Clemens 759818d289 DB IDO: Make check_source a varchar(255) column
fixes 

Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
2016-06-17 11:03:26 +02:00
Michael Friedrich b4c56e5f47 Remove duplicate last_check runtime macro
Already available as {host,service}.last_check attribute.

refs 
2016-06-16 17:39:59 +02:00
Gunnar Beutner 039461e218 Fix unit tests for Convert::ToString
refs 
2016-06-16 15:32:29 +02:00
Gunnar Beutner bc6f7d7a21 Fix incorrect formatting for some macro values
fixes 
2016-06-16 15:14:35 +02:00
Gunnar Beutner d415ff7373 Add missing OnConfigLoaded calls in Ido{My,Pg}sqlConnection
fixes 
2016-06-16 14:22:20 +02:00
Gunnar Beutner c99fb68c2d Implement support for getting a list of global variables from the API
fixes 
2016-06-16 08:38:15 +02:00
Gunnar Beutner 28dee2b79b Improve filter support for /v1/templates
refs 
2016-06-16 08:38:15 +02:00
Michael Friedrich 2b474823f8 API: Fix that /v1 returns html if json is requested
fixes 
2016-06-15 17:46:09 +02:00
Michael Friedrich cdd858a0ec Flapping{Start,End} notifications must not depend on state changes
fixes 
2016-06-15 17:43:37 +02:00
Michael Friedrich 399ae42a8c DB IDO: Fix comment/downtime entry_time reset
fixes 
2016-06-15 11:28:57 +02:00
Gunnar Beutner 8a714d66f1 Ensure that sent notifications are synced between Icinga instances
fixes 
2016-06-15 11:27:01 +02:00
Gunnar Beutner 45919b4844 Fix crash in ApiListener::PersistMessage
fixes 
2016-06-15 11:26:35 +02:00
Gunnar Beutner ace6882b59 Implement support for retrieving a list of templates from the API
fixes 
2016-06-15 07:41:51 +02:00
Michael Friedrich f7f976b962 DB IDO: Ensure that SOFT state changes with the same state are logged
fixes 
2016-06-14 11:08:28 +02:00
Gunnar Beutner ff57b0ccd6 Add name attribute for the WorkQueue class
fixes 
2016-06-14 09:08:04 +02:00
Gunnar Beutner a8209c1a1a Change which instance is responsible for initiating notifications in a HA setup
refs 
2016-06-14 07:57:52 +02:00
Gunnar Beutner eb4aa4415c Fix cluster permissions for SendNotifications messages
refs 
2016-06-13 11:13:25 +02:00
Gunnar Beutner cb01f96dad Don't forward SendNotifications messages to non-local zones
refs 
2016-06-13 10:48:59 +02:00
Markus Frosch 8808e709c9 Make change to OK always a hard state
refs 
2016-06-13 10:43:57 +02:00
Gunnar Beutner 9e29a3f8a0 Fix default behavior when none of the specified objects pass the user's permission filter
fixes 
2016-06-13 10:14:10 +02:00
Markus Frosch a5abe1a972 Allow debugging of Utility::GetTime
So we can run unit tests that expect a certain behavior based on time.

When Icinga 2 is compiled with I2_DEBUG one can use Utility::SetTime to
override the current system time, and lock it to this value.

fixes 
2016-06-09 14:25:51 +02:00
Simon Murray 2e8c8809ea Add service metadata to InfluxDB Writer
Adds a new configuration variable in keeping with the graphite writer
which defaults to false to save network bandwidth.  All metrics currently
supported by graphite are now available to InfluxDB.  I added in some
formatting functions, to handle integers and booleans as we know and
control their types, and the supporting regexes in the sanity checker.

Updating to InfluxDB 0.13.X started giving 400 errors due to the missing
Host header in HTTP/1.1 requests.  HttpRequest has been updated to auto-
magically add the host and port to these requests if not explicitly
stated by the client code.

The exception code has been cleaned up to break out of the function
early if such a condition is raised, this avoids unnecessarily executing
code which will ultimately fail.

fixes 

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
2016-06-08 13:23:52 +02:00
Simon Murray 899592c8ad Update InfluxDB line formatting
Fixes a couple issues to do with line formatting of influx DB data points.  All
keys and values need commas and white space escaping.  Values are also checked
for type.  If a numeric or scientific value is detected this is output as an
Influx floating point/scientific number.  Booleans are detected and output in
a canonical format.  All other values are strings, which have double quotes
escaped and the entire string is wrapped in double quotes.  The handling of
thresholds has changed before this becomes officially released.  These values
if available are passed to the accumulation function in a dictionary, said
dictionary builds a single data point with multiple fields, rather than the
existing 5 data points, thus saving bandwidth costs.

fixes 

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
2016-06-08 11:01:23 +02:00
Gunnar Beutner 0eb0992d5e Fix custom notifications in a HA zone
fixes 
2016-06-07 12:44:12 +02:00
Michael Friedrich 8b742e841f Ensure that obsolete comment/downtime objects are deleted after activating objects
Config validation shouldn't be able to purge the files, only on
restart.

fixes 
2016-06-06 13:07:49 +02:00
Michael Friedrich 0ce41399e0 DB IDO: Ensure to delete outdated comments/downtimes for host/service objects
fixes 
2016-06-03 14:40:37 +02:00
Gunnar Beutner aeb7a4a70b Fix incorrect check interval for SOFT->HARD transitions
fixes 
2016-05-24 11:05:29 +02:00
Philipp Dallig 54e1c8a9d5 Implement exclude and include ability for TimePeriod objects
This feature allows to exclude and include specific time period
objects and their time ranges from an existing time period object.

This comes in handy when e.g. excluding holidays.

fixes 

Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
2016-05-21 20:33:09 +02:00
Michael Friedrich d49b63d2ab Fix: First HARD state does not change retry_interval to check_interval
refs 
2016-05-21 18:58:19 +02:00
Michael Friedrich 3f1a9f150b Silence compiler warnings
refs 
2016-05-21 14:16:47 +02:00
Michael Friedrich b4843dc81b Fix: Volatile check results for OK->OK transitions are logged into DB IDO statehistory
fixes 
2016-05-21 13:41:43 +02:00
Michael Friedrich e27dee5476 Windows: Fix missing path for repository handler
fixes 
2016-05-21 13:05:35 +02:00
Gunnar Beutner 78705e74f3 Open the command pipe with O_RDWR
fixes 
2016-05-18 15:52:29 +02:00
Gunnar Beutner b99b373b6f Fix 100% CPU usage issue and incorrect pending checks accounting in CheckerComponent::CheckThreadProc
fixes 
2016-05-18 14:30:36 +02:00
Gunnar Beutner bb69540b32 Fix exception in PerfdataWriter::RotateFile
fixes 
2016-05-18 14:01:32 +02:00
Gunnar Beutner 222b90107f Fix crash in ConfigItem::Commit
fixes 
2016-05-18 12:53:41 +02:00
Gunnar Beutner 93da47a670 Fix PostgreSQL warnings on startup
fixes 
2016-05-17 10:32:38 +02:00
Gunnar Beutner bc12d6c0d6 Fix race condition in ConfigObject::SetAuthority
fixes 
2016-05-12 14:06:28 +02:00
Gunnar Beutner 97a5091abc Fix incorrect re-scheduling behavior for command_endpoint checks
refs 
2016-05-12 13:47:32 +02:00
Gunnar Beutner de1b70cf44 Fix incorrect variable names for joined fields in filter expressions
fixes 
2016-05-12 10:24:15 +02:00
Michael Friedrich 3c852311e1 Fix possible crash in Add{Comment,Downtime}
refs 
2016-05-11 16:12:09 +02:00
Gunnar Beutner 1ad4d9cd27 Report failed reload attempts for the icinga check
fixes 
fixes 
fixes 
2016-05-11 16:07:28 +02:00
Gunnar Beutner 0b95be7b99 Fix incorrect calculation in Downtime::IsInEffect
fixes 
2016-05-11 14:13:43 +02:00
Michael Friedrich 90f102abf3 Ensure that program status updates are immediately updated in DB IDO
fixes 
2016-05-11 14:03:40 +02:00
Gunnar Beutner 0bc139af93 Improve timing behavior for UpdateObjectAuthority calls
refs 
2016-05-11 13:04:39 +02:00
Gunnar Beutner fc1168ed3e Only activate HARunOnce objects once there's a cluster connection
fixes 
2016-05-11 12:50:40 +02:00
Michael Friedrich a529725a92 Fix overloaded command pipe errors
fixes 
2016-05-11 11:04:28 +02:00
Gunnar Beutner 2adfcb56fe Improve error handling for TlsStream::Handshake
fixes 
2016-05-11 10:09:54 +02:00
Gunnar Beutner b9fdb3bfd9 Make sure that object names aren't empty
fixes 
2016-05-11 09:48:18 +02:00
Jason Young 7dbd66535a Throw exception if PerfdataWriter::RotateFile fails to rename from host_temp_path to host_perfdata_path (and same for service)
This can happen if the two paths are not on the same mount-point.

fixes 

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
2016-05-11 09:29:32 +02:00
Gunnar Beutner ed27130402 Fix: "day -X" time specifications are parsed incorrectly
fixes 
2016-05-11 09:23:55 +02:00
Gunnar Beutner 81a7a002b4 Improve validation for flow control statements
fixes 
2016-05-11 08:01:31 +02:00
Michael Friedrich 9a88185b12 API: Fix error handling for invalid JSON request body
fixes 
2016-05-10 15:16:35 +02:00
Michael Friedrich 1c6f09f44e API: Fix error message handling for invalid attributes in PUT requests
refs 
2016-05-10 13:43:36 +02:00
Michael Friedrich ba82d2eb20 Move CalculateExecutionTime and CalculateLatency into the CheckResult class
fixes 
2016-05-10 12:16:49 +02:00
Gunnar Beutner f6f3bd1e4c Implement support for limiting the number of concurrent checks
fixes 
2016-05-10 11:26:55 +02:00
Gunnar Beutner eab2fb79ad Fix crash in UnameHelper()
fixes 
2016-05-10 09:46:48 +02:00
Gunnar Beutner 1fb378ef4a Remove unused cluster commands
fixes 
2016-05-10 07:05:10 +02:00
Michael Friedrich 8a65c4a776 API: Fix error message with PUT requests for existing objects
fixes 
2016-05-09 15:08:35 +02:00
Gunnar Beutner b8e911b0e5 Make sure the dependency graph is properly updated when adding and removing objects
fixes 
fixes 
2016-05-09 14:30:12 +02:00
Lee Clemens 7050529976 Add SSL support for the IdoMysqlConnection feature
fixes 

Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
2016-05-03 15:01:32 +02:00
Simon Murray 79c1e883d1 Add InfluxDB Writer
Adds an Icinga2 object to directly interface with InfluxDB's native HTTP API.
This supports optional basic authorization, and TLS transport.  InfluxDB didn't
appear to like having the TLS stream kept open, so instead this object buffers
data points which are then flushed to InfluxDB as a batch write, either driven
by a configurable timeout or threshold.

As InfluxDB is a schema-less database the host and service templates are user
configurable allowing both the measurement field and tags to be set by the
end user via macro expansion.  This allows access to tag fields from arbitrary
data associated with host.vars or service.vars.  If a particular value is
unable to be resolved, the tag will be dropped and not transmitted to InfluxDB.

Also alters URL handling to omit array brackets when only a single value is
attached to a key, otherwise InfluxDB has a strop with non-standard syntax.

fixes 

Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
2016-05-03 14:12:51 +02:00
Michael Friedrich 2faf121ff4 Remove commentsand downtimes with reference to deleted checkable objects
Silence the warning message and change the log level to notice as well.

fixes 
2016-05-03 11:30:02 +02:00
Michael Friedrich 23ab6cf78b Fix: Expired downtimes are not removed
fixes 
2016-05-02 15:32:46 +02:00
Jean Flach 360e0ad548 Fix external commands comments crashing icinga
Now an exception will be thrown when AddSvcComment or AddHostComment are
run with and empty Author or comment

fixes 
2016-04-25 16:58:00 +02:00
Gunnar Beutner 93a09b874b Remove the (unused) 'inherits' keyword
fixes 
2016-04-22 13:49:30 +02:00
Michael Friedrich 7442cd94f5 Fix crash with empty ScheduledDowntime 'ranges' attribute
fixes 
2016-04-22 11:00:21 +02:00
Gunnar Beutner c54de4b615 Implement SNI support for the CLI commands
fixes 
2016-04-21 15:44:51 +02:00
Gunnar Beutner 8b7d59eb34 Implement support for subjectAltName in SSL certificates
fixes 
2016-04-21 15:25:57 +02:00
Gunnar Beutner 2d55cf1341 Implement validation for the Logger#severity attribute
fixes 
2016-04-21 13:50:47 +02:00
Gunnar Beutner 4a32211de2 Fix crash in Ido{Mysql,Pgsql}Connection::ExecuteMultipleQueries
fixes 
2016-04-21 09:17:40 +02:00
Michael Friedrich d5c0d7366d Fix: Failed assertion in IdoPgsqlConnection::FieldToEscapedString
fixes 
2016-04-20 18:21:39 +02:00
Gunnar Beutner 22cf939086 Build fix for Windows
refs 
2016-04-19 14:48:13 +02:00