Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #19206: Missing cron task for application of monitoring templates #367

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 11 additions & 5 deletions zabbix/packaging/postinst
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
#!/bin/bash

CONFFILE="/opt/rudder/etc/zabbix.conf"
CRONFILE="/etc/cron.d/zabbix-rudder"

mkdir -p /var/rudder/plugin-resources
echo "0 * * * * /opt/rudder/bin/zabbix-plugin.py update " > /etc/cron.d/zabbix-rudder

# create cron file
if [ ! -f "${CRONFILE}"]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably replace it, I don't know why this test. Do you know @peckpeck?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was to avoid changing user modified cron, in some case it is probably better to replace it

cat > "${CRONFILE}" <<EOF
0 * * * * root /opt/rudder/bin/zabbix-plugin.py update
*/2 * * * * root /opt/rudder/bin/zabbix-plugin apply-configuration >/dev/null
EOF
fi

# create configuration file
if [ ! -f "${CONFFILE}" ]
then
if [ ! -f "${CONFFILE}" ]; then
cat > "${CONFFILE}" <<EOF
[ZABBIX]
username = YOUR_ZABBIX_USERNAME
Expand All @@ -19,4 +26,3 @@ rudderAPIURL = https://localhost/rudder/api/latest
rudderAPIToken = YOUR_RUDDER_API_TOKEN
EOF
fi