Commit Graph

315 Commits

Author SHA1 Message Date
Gunnar Beutner 1ef7399cea Remove support for anonymous dictionary items. 2013-03-14 12:40:02 +01:00
Gunnar Beutner 442a2dbc7d Implement timeperiods. 2013-03-13 16:04:53 +01:00
Gunnar Beutner 98ab009b91 Cleaned up VS project files. 2013-03-12 19:49:24 +01:00
Gunnar Beutner c594ee7c30 Fix compiler warnings on Windows. 2013-03-12 18:56:13 +01:00
Gunnar Beutner 98f7515eee Fix writing the PID file if there is no previous PID file. 2013-03-12 16:02:35 +01:00
Gunnar Beutner 5fcdc51e3c Windows build fix. 2013-03-12 15:35:51 +01:00
Gunnar Beutner 62cb4e14a6 Make mode variable const. 2013-03-12 14:50:40 +01:00
Gunnar Beutner 9ea0cb4353 Truncate the PID file before writing the new PID. 2013-03-12 14:06:59 +01:00
Gunnar Beutner fc337a51e7 Add missing default implementation for DynamicObject::Stop(). 2013-03-12 14:01:11 +01:00
Gunnar Beutner d7492ab823 Remove libpopen_noshell. 2013-03-12 14:01:01 +01:00
Gunnar Beutner 69a2842d4e Implement DynamicObject::Stop(). 2013-03-12 13:48:37 +01:00
Gunnar Beutner 3c363499bb Eliminate the Component class.
Fixes #3832
Fixes #3840
2013-03-12 13:45:54 +01:00
Gunnar Beutner 91c82263a5 Fix some deadlocks in the TlsStream class. 2013-03-12 11:56:14 +01:00
Gunnar Beutner 4b2d828b99 Refactor the init script and remove the -d option.
Fixes #3666
2013-03-12 11:48:45 +01:00
Gunnar Beutner 412a44e697 Windows build fix. 2013-03-11 14:08:55 +01:00
Gunnar Beutner d8edd98e41 Add more information to exceptions. 2013-03-11 13:47:17 +01:00
Gunnar Beutner 6f51230a79 Don't instantiate abstract objects.
Fixes #3669
2013-03-11 12:04:10 +01:00
Gunnar Beutner c728e85c8c Implement attribute filters. 2013-03-10 15:11:32 +01:00
Gunnar Beutner 98ba1424b5 Implement proper support for JSON arrays. 2013-03-10 09:08:59 +01:00
Gunnar Beutner a38263b3c8 Implement livestatus commands. 2013-03-10 05:10:51 +01:00
Gunnar Beutner 27505536f9 Add livestatus component. 2013-03-10 03:09:01 +01:00
Gunnar Beutner 375746d710 Fix deadlocks in the Socket/Stream classes. 2013-03-09 15:56:56 +01:00
Gunnar Beutner 5a861b0de0 Fix race condition in Process::WorkerThreadProc. 2013-03-09 15:41:07 +01:00
Gunnar Beutner bac7495f49 Check for invalid value type. 2013-03-09 12:57:26 +01:00
Gunnar Beutner 84fcf24fa3 Add missing return value. 2013-03-09 12:57:07 +01:00
Gunnar Beutner 56dc7c4e0a Add missing "*/". 2013-03-09 12:56:40 +01:00
Gunnar Beutner 9b44a5c35d Fixed incorrect macro name. 2013-03-09 12:53:04 +01:00
Gunnar Beutner 16b0722cbc Added more templates. 2013-03-08 16:02:33 +01:00
Gunnar Beutner 13436cb536 Catch exceptions in EventQueue::QueueThreadProc. 2013-03-08 14:43:07 +01:00
Gunnar Beutner 756d465ca9 Use TLS for last exception stack trace. 2013-03-08 14:42:41 +01:00
Gunnar Beutner cada2abeb3 Implement automated stacktraces for exceptions. 2013-03-07 19:44:39 +01:00
Gunnar Beutner e2416b5b54 Check return values of SymGetLineFromAddr64 and SymFromAddr. 2013-03-07 16:00:10 +01:00
Gunnar Beutner e54604c0e3 *NIX build fix. 2013-03-07 15:16:01 +01:00
Gunnar Beutner fa3f01667f Implemented stacktrace support for Windows. 2013-03-07 15:00:26 +01:00
Gunnar Beutner 97dd87ab96 Fixed compiler warnings. 2013-03-07 08:14:55 +01:00
Gunnar Beutner 659fcf8fa3 Fix cppcheck warnings. 2013-03-06 15:41:13 +01:00
Gunnar Beutner 6f7b553acd Bugfixes for the *:Invalidate*Cache() calls. 2013-03-06 13:01:51 +01:00
Gunnar Beutner 70fa21dfbc Various bugfixes. 2013-03-06 11:04:20 +01:00
Gunnar Beutner be95f3171d Even more code refactoring. 2013-03-04 15:52:42 +01:00
Gunnar Beutner a6d26a2dc1 Windows build fix. 2013-03-02 14:21:13 +01:00
Gunnar Beutner 48485c5f26 More lock refactoring. Yay. 2013-03-02 09:07:47 +01:00
Gunnar Beutner 572a477da3 Refactored object locking code. 2013-03-01 12:07:52 +01:00
Gunnar Beutner 959b7fa16a Implement support for deserializing JSON arrays. 2013-02-28 14:06:30 +01:00
Gunnar Beutner b674d46557 Implemented the LONGDATETIME, SHORTDATETIME, DATE and TIME macros. 2013-02-28 10:27:33 +01:00
Gunnar Beutner e9d32eeada Implemented user groups. 2013-02-27 21:49:03 +01:00
Gunnar Beutner e9648f35bc Make the services/notifications caches thread safe.
Send notifications based on the notification_interval setting.
2013-02-27 12:44:51 +01:00
Gunnar Beutner 45f8bfb730 Checker: Use Ptrs rather than WeakPtrs.
Fixes #3732
2013-02-26 10:58:32 +01:00
Gunnar Beutner f027f1681b Windows build fix. 2013-02-26 10:57:44 +01:00
Gunnar Beutner 35c79a76c1 Make attribute lookups O(1). 2013-02-26 10:13:54 +01:00
Gunnar Beutner d011f09f32 Windows build fixes. 2013-02-24 08:52:09 +01:00
Gunnar Beutner 022be22fa2 Added some missing files. 2013-02-24 08:27:00 +01:00
Gunnar Beutner 2ef255b9f6 Fine-grained locks (WIP, Part 9). 2013-02-24 01:10:34 +01:00
Gunnar Beutner 404b1807e6 Removed PCH support (as it's clearly not working properly). 2013-02-22 08:12:43 +01:00
Gunnar Beutner 4306c6c07a Fine-grained locks (WIP, Part 8). 2013-02-21 16:12:50 +01:00
Gunnar Beutner 5e91f6c54d Fine-grained locks (WIP, Part 7). 2013-02-20 19:52:25 +01:00
Gunnar Beutner 997ca3a77a Fine-grained locks (WIP, Part 6). 2013-02-19 23:02:08 +01:00
Gunnar Beutner 1daeb8c010 Fine-grained locks (WIP, Part 5). 2013-02-19 12:17:31 +01:00
Gunnar Beutner ecc95b3dc0 Fine-grained locks (WIP, Part 4). 2013-02-19 07:26:52 +01:00
Gunnar Beutner 3dace35cf1 Fine-grained locks (WIP, Part 3). 2013-02-18 23:44:24 +01:00
Gunnar Beutner a4c7052a6e Fine-grained locks (WIP, Part 2). 2013-02-18 14:40:24 +01:00
Gunnar Beutner c63c28dd9c Fine-grained locks (WIP, Part 1). 2013-02-17 19:14:34 +01:00
Gunnar Beutner 79bf945868 Implement calling Python functions. 2013-02-16 07:49:36 +01:00
Gunnar Beutner 172938b19d Bugfix: Unlock thread mutex while waiting for events. 2013-02-16 07:27:45 +01:00
Gunnar Beutner d0481ea578 Remove support for type hints. 2013-02-15 18:35:40 +01:00
Gunnar Beutner 4998563a74 Implemented calling ScriptFunctions from Python. 2013-02-15 16:34:33 +01:00
Gunnar Beutner a022be9de2 Implemented Value::GetType(). 2013-02-15 14:39:26 +01:00
Gunnar Beutner 3ee1dbc94c Implement event for registering/unregistering script functions.
Fixes #3704
2013-02-15 10:10:41 +01:00
Gunnar Beutner 2e7e0c6473 Make ScriptFunction::GetFunctions() public. 2013-02-15 09:59:04 +01:00
Gunnar Beutner 4e03b916ff Bugfix: Set main EventQueue's owner as early as possible. 2013-02-15 09:58:38 +01:00
Gunnar Beutner 023d17c675 Implement per-thread event queues. 2013-02-15 06:48:30 +01:00
Gunnar Beutner 2faca52744 Bug fixes for script function calls. 2013-02-15 05:04:38 +01:00
Gunnar Beutner 2485a04694 Properly shut down the interpreter when the Script object is being destroyed. 2013-02-14 19:00:46 +01:00
Gunnar Beutner 8e672167dc Added missing lock() call. 2013-02-14 18:48:31 +01:00
Gunnar Beutner 8f2ce8e703 Implemented rudimentary function call forwarding for ScriptInterpreter objects. 2013-02-14 16:47:36 +01:00
Gunnar Beutner d3928a7e69 Pass argc and argv to the Python interpreter. 2013-02-14 16:18:58 +01:00
Gunnar Beutner d4afb4087d Properly shut down instances of the ScriptInterpreter class. 2013-02-14 15:39:53 +01:00
Gunnar Beutner 74b122d430 Implemented the 'Script' type. 2013-02-14 14:58:26 +01:00
Gunnar Beutner 7fac5b454e Basic support for other scripting languages. 2013-02-14 12:02:02 +01:00
Gunnar Beutner 099821ce07 Windows build fix. 2013-02-14 10:59:01 +01:00
Gunnar Beutner c91191e701 Implement global mutex (for use by scripting languages). 2013-02-14 10:55:47 +01:00
Gunnar Beutner 49576d3a82 Use #if rather than #ifdef to check HAVE_* macros. 2013-02-14 10:55:15 +01:00
Gunnar Beutner 9412b2be35 Use -fvisibility=hidden when it's available. 2013-02-14 10:53:34 +01:00
Gunnar Beutner f4d8791424 Fixed parameters for pipe2() call. 2013-02-13 21:05:58 +01:00
Gunnar Beutner 1d807d91bc Implemented dictionary support for commands. 2013-02-13 20:08:09 +01:00
Gunnar Beutner cf094fe4b3 Bugfix: the main task fd must not be non-blocking. 2013-02-13 15:41:14 +01:00
Gunnar Beutner 26e2da7a7d Refactor the FD_CLOEXEC/O_NONBLOCK code. 2013-02-13 13:03:21 +01:00
Gunnar Beutner fac2304ae5 Fixed incorrect use of F_SETFL. 2013-02-13 12:47:51 +01:00
Gunnar Beutner 4f2021633b Fixed incorrect use of O_CLOEXEC. 2013-02-13 12:39:47 +01:00
Gunnar Beutner d076bb0a93 Fixed another file descriptor leak. 2013-02-13 12:34:25 +01:00
Gunnar Beutner d2650df8b6 Cleaned up the Process class. 2013-02-13 11:48:19 +01:00
Gunnar Beutner d6fcc33be4 Refactor the Process class. Remove the Windows implementation for now. 2013-02-13 11:39:24 +01:00
Gunnar Beutner 800750c415 Build fix. 2013-02-13 07:48:08 +01:00
Gunnar Beutner b0d8c40d20 Process: repeat read() until we get EAGAIN. 2013-02-13 07:39:26 +01:00
Gunnar Beutner a80872b314 Use pipe2() instead of pipe() when possible. 2013-02-13 07:33:14 +01:00
Gunnar Beutner 2893134940 Make Application::ProcessEvents() static. 2013-02-13 07:25:36 +01:00
Gunnar Beutner cf920cd0f2 Wait for child processes before getting new tasks from the list. 2013-02-11 23:18:26 +01:00
Gunnar Beutner 2501ff805a Remove Host::OnInitCompleted and clean up the classes' constructors.
Fixes #3678
2013-02-11 14:01:52 +01:00
Gunnar Beutner f6f771a3f6 Remove support for _DEBUG env var.
Fixes #3688
2013-02-11 13:46:02 +01:00
Gunnar Beutner 5fab16a223 Fixed uninitialized variable bug. 2013-02-11 06:38:30 +01:00
Gunnar Beutner a3f03928d7 Process: use read() on *NIX. 2013-02-11 00:05:11 +01:00
Gunnar Beutner bddd9ebf0b Implemented poll() support for Process tasks.
Fixes #3035
2013-02-10 23:31:11 +01:00
Gunnar Beutner 7ce98ed374 Use multiple worker threads for Process tasks. 2013-02-10 22:29:42 +01:00
Gunnar Beutner aa2322abbb Fixed deadlock in Process::WorkerThreadProc. 2013-02-10 21:53:08 +01:00
Gunnar Beutner 67aef452e5 Windows build fix. 2013-02-10 19:09:35 +01:00
Gunnar Beutner bd80f4597e Windows build fix. 2013-02-10 18:57:23 +01:00
Gunnar Beutner 4e9afd7c2c Build fix V2. 2013-02-10 17:44:03 +01:00
Gunnar Beutner 8667bba7e0 Build fix for *NIX systems with a non-GNU libc. 2013-02-10 17:15:18 +01:00
Gunnar Beutner 0e7a3c67ec Bugfixes for the Process class. 2013-02-10 12:45:39 +01:00
Gunnar Beutner fc6df0ecbd Fixed 1 second delay for child processes. 2013-02-10 01:35:40 +01:00
Gunnar Beutner ee37e0cace Implemented environment-based macros. 2013-02-09 23:02:33 +01:00
Gunnar Beutner 686191103f Fixed spelling mistake. 2013-02-09 18:43:11 +01:00
Gunnar Beutner cf92cd83b3 Implement some dynamic macros.
Move check-specific code to service-check.cpp
2013-02-09 18:39:43 +01:00
Gunnar Beutner 3ab071fbcb Made the debug log level slightly less spammy. 2013-02-09 10:55:54 +01:00
Gunnar Beutner 85e469019f Windows bugfixes for Utility::DirName and Utility::Glob. 2013-02-09 10:43:11 +01:00
Gunnar Beutner 6c23481a55 Bugfix: Local events for changed attributes aren't processed at transaction commit time.
Fixes #3605
2013-02-08 23:40:28 +01:00
Gunnar Beutner 580f2e1fcc Use Host constructor/destructor/OnAttributeChange instead of OnCommitted/OnRemoved for Host->services
Fixes #3612
2013-02-08 21:05:08 +01:00
Gunnar Beutner 7526ee3a9e Bugfix: assert in Timer::ProcessTimers. 2013-02-08 10:39:54 +01:00
Gunnar Beutner ad04a02153 Bugfix: Fixed incorrect variable name. 2013-02-08 10:30:32 +01:00
Gunnar Beutner 513b3d6820 Bugfix: Don't leak lock file's fd into child processes. 2013-02-08 10:23:01 +01:00
Gunnar Beutner 601c7d25d1 Implement sub-second check intervals.
Fixes #3656
2013-02-08 10:17:41 +01:00
Gunnar Beutner dd9c7b9846 Flush logger stream after writing 'clear color' ANSI code. 2013-02-08 09:40:19 +01:00
Gunnar Beutner 607915c49a Windows: Fixed crash in Object::~Object(). 2013-02-07 22:13:34 +01:00
Gunnar Beutner c04cfb9dac Make sure that unnamed items in a dictionary are always in the order they were inserted in. 2013-02-07 09:36:17 +01:00
Gunnar Beutner f64bdc8788 Removed obsolete timeperiod code. 2013-02-06 12:59:56 +01:00
Gunnar Beutner b887f14d96 Use BOOST_THROW_EXCEPTION instead of boost::throw_exception()
Fixes #3636
2013-02-06 12:51:12 +01:00
Gunnar Beutner e047e06fc8 Finish implementing %validator.
Fixes #3634
2013-02-06 12:09:50 +01:00
Gunnar Beutner eadb309dab Bugfix: Add missing parenthesis in function call. 2013-02-06 11:39:32 +01:00
Gunnar Beutner 53705d16dc Implement AsyncTask::Wait() and make completion callbacks optional. 2013-02-06 10:56:06 +01:00
Gunnar Beutner 7a150d2c29 Validate config objects before trying to activate them.
Fixes #3619
2013-02-05 13:06:42 +01:00
Gunnar Beutner 383d2369b1 Bugfix: Make sure Utility::Glob return false if no matching files were found. 2013-02-03 01:30:19 +01:00
Gunnar Beutner 5774792a23 Implemented --version and made --help output prettier. 2013-02-03 01:21:11 +01:00
Gunnar Beutner dbf762e771 Use boost::program_options to parse arguments.
Fixes #3536
Fixes #3184
2013-02-02 23:22:27 +01:00
Gunnar Beutner f2e17bdd09 Fixed compiler warnings (-Wextra). 2013-02-02 22:13:54 +01:00
Gunnar Beutner 5438c86e76 Throw exception in Utility::ToDouble/Utility::ToLong
Fixes #3617
2013-02-02 20:19:00 +01:00
Gunnar Beutner b74c2c8a68 Removed the old-style validation code. 2013-02-02 20:03:30 +01:00
Gunnar Beutner 33aba14197 Implement type keyword in the config compiler
Fixes #3616
2013-02-02 14:28:11 +01:00
Gunnar Beutner 18f935cfa2 Added missing const qualifiers. 2013-02-02 09:19:49 +01:00
Gunnar Beutner 11cf07fa9c Config: implement support for wildcard includes
Fixes #2771
2013-02-02 00:32:18 +01:00
Gunnar Beutner 04fd703e6a Windows build fix. 2013-02-01 23:10:48 +01:00
Gunnar Beutner 00b827d5cf Implement search dirs for #include.
Fixes #3599
2013-02-01 22:44:58 +01:00
Gunnar Beutner 66f28ae02b Build fix for Windows. 2013-02-01 19:36:47 +01:00
Gunnar Beutner 05d0dc5683 Display "debug message" for exceptions (in addition to SIGABRT). 2013-02-01 19:11:15 +01:00
Gunnar Beutner 8a469e190f Fixed some more compiler warnings (when using -Wall). 2013-02-01 19:02:07 +01:00
Gunnar Beutner ee6ba4e5e9 Bug: clearing attributes should only reset their value and tx rather than deleting them entirely
Fixes #3604
2013-02-01 19:01:51 +01:00
Gunnar Beutner 7835563e03 Fixed some compiler warnings. 2013-02-01 15:44:03 +01:00
Gunnar Beutner df1199f206 Updated messages in the SIGABRT handler. 2013-02-01 14:46:06 +01:00
Gunnar Beutner 0ca8012079 Made warning and critical messages bold. 2013-02-01 14:21:11 +01:00
Gunnar Beutner 886fd3a5b8 Implemented colored log messages. 2013-02-01 14:12:24 +01:00
Gunnar Beutner f5a3dc4d84 Config: Warn about unknown attributes. 2013-02-01 14:11:22 +01:00
Gunnar Beutner e928b1fabf Bugfix: Missing parent object causes assert in ReplicationComponent::Stop
Fixes #3601
2013-02-01 11:46:52 +01:00