diff --git a/checkmk/custom-files/local/monitor_hshinfo b/checkmk/custom-files/local/monitor_hshinfo new file mode 100644 index 0000000000000000000000000000000000000000..d14ff856760355f28dbcf3c19e8f98006a42c730 --- /dev/null +++ b/checkmk/custom-files/local/monitor_hshinfo @@ -0,0 +1,8 @@ +#!/bin/bash + +REMAINING_LIBRARY_IDS=$(sudo -u postgres -- psql -qtAX -d hshinfo -c "select (maximum_value::bigint - (SELECT last_value FROM hshinfo.seq_raw_library_id)) from information_schema.sequences where sequence_schema = 'hshinfo' and sequence_name = 'seq_raw_library_id';") + +REMAINING_LUH_IDS=$(sudo -u postgres -- psql -qtAX -d hshinfo -c "select count(*) from hshinfo.username_luh where allocated = false;") + +echo "P watch_lib_ids remaining_library_ids=$REMAINING_LIBRARY_IDS;400:;200: hshinfo.seq_raw_library_ids" +echo "P watch_luh_ids remaining_luh_ids=$REMAINING_LUH_IDS;1000:;100: hshinfo.usernames_luh with allocated = false" \ No newline at end of file diff --git a/checkmk/custom-files/local/remaining_library_ids b/checkmk/custom-files/local/remaining_library_ids deleted file mode 100644 index dbf9955985d220d000806fd06c09299b1d19758c..0000000000000000000000000000000000000000 --- a/checkmk/custom-files/local/remaining_library_ids +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -REMAINING=$(sudo -u postgres -- psql -qtAX -d hshinfo -c "select (maximum_value::bigint - (SELECT last_value FROM hshinfo.seq_raw_library_id)) from information_schema.sequences where sequence_schema = 'hshinfo' and sequence_name = 'seq_raw_library_id';") - -echo "P watch_lib_ids remaining_library_ids=$REMAINING;400:;200: hshinfo.seq_raw_library_ids" diff --git a/checkmk/debian/monitor_hshinfo.sls b/checkmk/debian/monitor_hshinfo.sls new file mode 100644 index 0000000000000000000000000000000000000000..ab753e93f14b1c7cd38930e8d37d54d1409cb398 --- /dev/null +++ b/checkmk/debian/monitor_hshinfo.sls @@ -0,0 +1,7 @@ +hsh_checkmk_monitor_hshinfo_local: + file.managed: + - name: /usr/lib/check_mk_agent/local/monitor_hshinfo + - source: salt://checkmk/custom-files/local/monitor_hshinfo + - mode: 755 + - user: root + - group: root \ No newline at end of file diff --git a/checkmk/debian/remaining_library_ids.sls b/checkmk/debian/remaining_library_ids.sls deleted file mode 100644 index 6fe076a75360c090b6a8637ce673548e26cefa0e..0000000000000000000000000000000000000000 --- a/checkmk/debian/remaining_library_ids.sls +++ /dev/null @@ -1,7 +0,0 @@ -hsh_checkmk_library_ids_local: - file.managed: - - name: /usr/lib/check_mk_agent/local/remaining_library_ids - - source: salt://checkmk/custom-files/local/remaining_library_ids - - mode: 755 - - user: root - - group: root \ No newline at end of file