Jean Flach
b59189b8d3
Simplify vector usage
...
Also leak less memory ;)
2019-11-02 14:00:23 +01:00
Jean Flach
6aaa35a0a6
Rewrite the RedisWriter
...
There should be more atomic commits but the whole thing was a mess. This
commit changes the synchrounous Redis connection into an asynchronous
one in its own class RedisConnection.
The RedisConnection uses a Workqueue with commands to fire against the
Redis server. When a response is required a callback must be supplied,
refer to RedisWriter::RedisGet().
Known Issues:
- Authentication has no error handling and can break the connection
- Error handling in general is iffy due to the nature of the async redis
connection
- Getting a reply out of RedisConnection is not trivial
- HandleRW... sunt dracones
2019-11-02 14:00:23 +01:00
Jean Flach
64515b81e3
Add disconnect
2019-11-02 14:00:23 +01:00
Jean Flach
d96dcf869e
Add RedisConnection object
...
This works using an async Redis connection. Multiple connections are not
possible. The connection is fed from a workqueue filled with
RedisCommands in the way of a vector of strings.
2019-11-02 14:00:23 +01:00
Jean Flach
0456298c58
Reformat code
...
CLion is now pretty close at what we use with Icinga, other changes do
make sense to me.
2019-11-02 14:00:23 +01:00
Jean Flach
8f411c7475
Support comments for icingadb
...
This splits comments into Host and Service comments
2019-11-02 14:00:23 +01:00
Alexander A. Klimov
ed3db5b491
Fix elephant oversight
2019-11-02 14:00:23 +01:00
Jean Flach
315e9ffad8
Stringify flat values
2019-11-02 14:00:23 +01:00
Alexander A. Klimov
d0a45521a9
Unify schema structure
...
refs #15
2019-11-02 14:00:23 +01:00
Jean Flach
c4962559ff
Remove parent_checksum
...
parent_checksum is always the first element in all_parents_checksums
2019-11-02 14:00:23 +01:00
Jean Flach
a47e16fb5b
Rename command_checksums
2019-11-02 14:00:23 +01:00
Jean Flach
65c38a3958
ignore user/usergroup for property checksum
2019-11-02 14:00:23 +01:00
Alexander A. Klimov
3a8cf8d74d
RedisWriter: dump missing checksums for notifications
...
refs #18
2019-11-02 14:00:23 +01:00
Alexander A. Klimov
4d40293217
RedisWriter: dump all_parents_checksum and all_parents_checksums for zones
2019-11-02 14:00:23 +01:00
Alexander A. Klimov
cd05240624
RedisWriter: dump period_checksum for users
2019-11-02 14:00:23 +01:00
Michael Friedrich
de99d68351
Only use the type for commands in the object identifier checksum
2019-11-02 14:00:23 +01:00
Jean Flach
c70316a835
Sync ranges_checksum for timeperiods
...
Signed-off-by: Michael Friedrich <michael.friedrich@icinga.com>
2019-11-02 14:00:23 +01:00
Alexander A. Klimov
3e0a2f59e2
RedisWriter: make config object identifiers type-aware
...
SHA1(PackObject([Environment, Type, __name]))
2019-11-02 14:00:23 +01:00
Alexander A. Klimov
b04b1d954e
RedisWriter: compute checksums of command arguments and env vars
...
refs #14
2019-11-02 14:00:23 +01:00
Alexander A. Klimov
a908f84750
Revert unneccessary dynamic_pointer_cast
2019-11-02 14:00:23 +01:00
Alexander A. Klimov
1b81b85582
RedisWriter: dump zone_checksum for endpoints
...
refs #11
2019-11-02 14:00:23 +01:00
Michael Friedrich
d65fb529eb
Simplify host_checksum
2019-11-02 14:00:23 +01:00
Jean Flach
d09a435fe3
Export usergroup(s)_checksum(s)
...
Warning: ugly code
2019-11-02 14:00:23 +01:00
Michael Friedrich
876d98a13f
Add 'parent_checksum' for zone objects
2019-11-02 14:00:23 +01:00
Michael Friedrich
bb2e7854fd
Add command_endpoint, event/check_command, action/notes_url, icon_image checksums for host/service objects
2019-11-02 14:00:23 +01:00
Michael Friedrich
4fb73a44bd
Add 'host_checksum' for services
2019-11-02 14:00:23 +01:00
Michael Friedrich
48f1ce215b
Drop obsolete delete query on config dump
2019-11-02 14:00:23 +01:00
Michael Friedrich
e31679b2de
Update Redis prefix namespaces and move their declaration into the class
...
icinga:config:object:<type>:<sha1>
icinga:config:checksum:<type> <sha1>
icinga:config:customvar:<type> <sha1>
icinga:status:object:<type>:<sha1>
This avoids multiple definitions all over the code. Maybe we want
to make the schema configurable at some point.
2019-11-02 14:00:23 +01:00
Michael Friedrich
3ce8f5599e
Fix missing object locks
2019-11-02 14:00:23 +01:00
Alexander A. Klimov
413e351805
RedisWriter: dump custom vars verbosely
2019-11-02 14:00:23 +01:00
Michael Friedrich
e4355f27c9
Send zone_checksum globally, if 'zone' attribute is set
2019-11-02 14:00:23 +01:00
Jean Flach
a4b0f9125e
Only sync zone_checksum when object in zone
2019-11-02 14:00:23 +01:00
Jean Flach
85f621cb90
Add zone checksum for redis to checkables
2019-11-02 14:00:23 +01:00
Michael Friedrich
c5e913dfd4
Fix error handling for GetSubscriptionTypes()
2019-11-02 14:00:23 +01:00
Alexander A. Klimov
50d83e850f
RedisWriter: dump endpoints' zones' identifiers (zone_checksum)
2019-11-02 14:00:23 +01:00
Alexander A. Klimov
550e385b9e
RedisWriter: fix checksums of disappeared config objects not being deleted
2019-11-02 14:00:23 +01:00
Alexander A. Klimov
d15769fa34
RedisWriter: fix disappeared config objects not being deleted
2019-11-02 14:00:23 +01:00
Alexander A. Klimov
e7411ea158
RedisWriter#UpdateAllConfigObjects(): use one transaction per config object type
2019-11-02 14:00:23 +01:00
Alexander A. Klimov
1ad9c80143
RedisWriter: sync all config objects atomically
2019-11-02 14:00:23 +01:00
Alexander A. Klimov
c92827fa5e
RedisWriter: dump monitored objects' groups' identifiers (group_checksums)
2019-11-02 14:00:23 +01:00
Alexander A. Klimov
724ce1f172
RedisWriter: dump also environment_checksum (per config object)
2019-11-02 14:00:23 +01:00
Alexander A. Klimov
4eee9572ab
RedisWriter: identify config objects by SHA1(PackObject([Environment, __name]))
2019-11-02 14:00:23 +01:00
Michael Friedrich
fae5b88e48
Add all stats similar to /v1/status
2019-11-02 14:00:23 +01:00
Michael Friedrich
d7f6d7994b
Move stats into a separate file
2019-11-02 14:00:23 +01:00
Alexander A. Klimov
3229982bee
RedisWriter: compute name_checksum as expected
2019-11-02 14:00:23 +01:00
Alexander A. Klimov
f05a5eecc2
Centralize identifier computation
2019-11-02 14:00:23 +01:00
Alexander A. Klimov
a5aef627f8
RedisWriter: use __name as object key
2019-11-02 14:00:23 +01:00
Alexander A. Klimov
3ea3b2ba27
RedisWriter: checksum package, source_location and templates separately in metadata_checksum
2019-11-02 14:00:23 +01:00
Alexander A. Klimov
e980485e23
RedisWriter: Explicitly checksum Zone#endpoints
2019-11-02 14:00:23 +01:00
Alexander A. Klimov
dcdf6b8a44
RedisWriter: Exclude explicitly checksummed properties from properties_checksum
2019-11-02 14:00:23 +01:00