Misc. simple utilities to aid version control and host maintenance.
Many tools are intended to be used in other shell scripts. Startup speed is of the essence, so you'll find very little Python here.
problem:
Traceback (most recent call last):
File "/usr/bin/zabdig", line 656, in <module>
main()
File "/usr/bin/zabdig", line 595, in main
(user, password) = get_from_secret_storage(args.section)
File "/usr/bin/zabdig", line 528, in get_from_secret_storage
res[0].ensure_not_locked()
File "/home/robin/.virtualenvs/kubernetes-ansible/lib/python3.10/site-packages/secretstorage/item.py", line 49, in ensure_not_locked
raise LockedException('Item is locked!')
secretstorage.exceptions.LockedException: Item is locked!
fix:
patch
--- /usr/bin/zabdig 2022-09-15 11:17:37.000000000 +0200
+++ zabdig 2022-09-30 11:47:12.660298476 +0200
@@ -507,6 +507,8 @@ def get_from_secret_storage(section):
attrs = {'application': 'zabdig'}
if section:
attrs['section'] = section
+ if coll.is_locked():
+ coll.unlock()
res = [i for i in coll.search_items(attrs)]
# FIXME: add 'or True' to overwrite previous passwords
if not res: # or True:
Does this read the end of packets correctly? Or should that be {2,39}
?
https://github.com/ossobv/vcutil/blob/main/gelf-payload-decode#L153-L164
If zabdig would be able to show webscenarios those could be exported into different tools to keep it in sync (e.g. prometheus blackbox exporter).
Ideas for output could be something like this:
output for all scenarios for a specific host:
$ zabdig host-with-webscenario webscenario
host-with-webscenario my-basic-webcheck
my-second-basic-webcheck
my-advanced-webcheck
output for all scenarios for a specific webcheck on that host:
$ zabdig host-with-webscenario webscenario my-basic-webcheck
my-basic-webcheck 1. https://basic-webcheck.com
2. https://basic-webcheck.com/login
3. https://basic-webcheck.com/status
We have the following configuration active in /etc/network/interfaces
:
auto bond0
iface bond0 inet static
address 192.168.1.25
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 8.8.4.4
bond-mode active-backup
bond-miimon 100
bond-slaves eno1 eno2
When using interfaces2netplan, it gives us the following stacktrace:
Traceback (most recent call last):
File "/usr/bin/interfaces2netplan", line 399, in <module>
main()
File "/usr/bin/interfaces2netplan", line 394, in main
files.show()
File "/usr/bin/interfaces2netplan", line 183, in show
yaml = self.get_yaml()
File "/usr/bin/interfaces2netplan", line 162, in get_yaml
ifile = InterfacesParser(interfaces_lines)
File "/usr/bin/interfaces2netplan", line 203, in __init__
self._parse()
File "/usr/bin/interfaces2netplan", line 255, in _parse
str(i) for i in e.args)))
ValueError: /etc/network/interfaces:24: parse fail at ' bond-mode active-backup': cmd 'bond-mode' unknown/unimplemented
The expected output would've been something like this:
network:
version: 2
renderer: networkd
bonds:
bond0:
interfaces:
- eno1
- eno2
addresses:
- 192.168.1.25/24
gateway4: 192.168.1.1
nameservers:
addresses:
- 8.8.8.8
- 8.8.4.4
parameters:
mode: active-backup
mii-monitor-interval: 100
or
network:
version: 2
renderer: networkd
bonds:
bond0:
interfaces: [eno1, eno2]
addresses: [192.168.1.25/24]
gateway4: 192.168.1.1
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
parameters:
mode: active-backup
mii-monitor-interval: 100
to easily spot if there are any webchecks who miss a trigger.
Its not super important actually but if there is a lot of action and/or your working with a slow zabbix this can be an indicator your looking at old data. Maybe its enough show a warning.
We could show if there are many items queued (Administration->Queue in zabbix web. There is an "Overview" and "Overview proxies" which might be relevant)
Or maybe just check some items from zabbix templates.
e.g there is a graph showing "zabbix internal process busy". Maybe just breaking down those values in a list is good enough. If its very busy you can expect some queueing.
cli utilities