Skip to content
Snippets Groups Projects
Commit 4832376d authored by Dennis Ahrens's avatar Dennis Ahrens
Browse files

monitor remaining luh_ids as well

parent e6e2666e
No related branches found
No related tags found
No related merge requests found
#!/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
#!/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"
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
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment