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

New Script: VictoriaMetrics #900

Closed
wants to merge 3 commits into from

Conversation

denisgolius
Copy link

@denisgolius denisgolius commented Dec 18, 2024

see also https://docs.victoriametrics.com/

✍️ Description

This PR adds VictoriaMetrics to the ProxmoxVE apps.
For more information, see our list of articles https://docs.victoriametrics.com/articles/


🛠️ Type of Change

Please check the relevant options:

  • [ *] New script (a fully functional and thoroughly tested script or set of scripts)

✅ Prerequisites

The following steps must be completed for the pull request to be considered:

  • [*] Self-review performed (I have reviewed my code to ensure it follows established patterns and conventions.)
  • [*] Testing performed (I have thoroughly tested my changes and verified expected functionality.)
  • [?] Documentation updated (I have updated any relevant documentation)

📋 Additional Information (optional)

Provide any extra context or screenshots about the feature or fix here.
2024-12-18_15-41

2024-12-18_15-42

See also:

@denisgolius denisgolius requested a review from a team as a code owner December 18, 2024 13:43
@github-actions github-actions bot added new script A change that adds a new script website A change to the website labels Dec 18, 2024
@michelroegl-brunner michelroegl-brunner changed the title adds VictoriaMetrics, cost-effective and scalable monitoring solution and time series database New Script: VictoriaMetrics Dec 18, 2024
@denisgolius
Copy link
Author

@michelroegl-brunner PTAL

scrape_interval: 10s
static_configs:
- targets: ['127.0.0.1:8428']
END

Choose a reason for hiding this comment

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

Suggested change
END
EOF

msg_info "Stopping ${APP}"
systemctl stop victoriametrics
msg_ok "Stopped ${APP}"
msg_info "Updating ${APP} to ${RELEASE}"
Copy link
Member

Choose a reason for hiding this comment

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

v${RELEASE}

systemctl stop victoriametrics
msg_ok "Stopped ${APP}"
msg_info "Updating ${APP} to ${RELEASE}"
mkdir -p /opt/victoriametrics
Copy link
Member

Choose a reason for hiding this comment

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

for what in update? Folder should already exists

tar -xf --delete victoria-metrics-linux-amd64-${RELEASE}.tar.gz -C /opt/victoriametrics
rm -rf victoria-metrics-linux-amd64-${RELEASE}.tar.gz
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP} to ${RELEASE}"
Copy link
Member

Choose a reason for hiding this comment

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

v${RELEASE}

msg_ok "Started ${APP}"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
Copy link
Member

Choose a reason for hiding this comment

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

v${RELEASE}

Comment on lines +18 to +20
curl \
sudo \
mc
Copy link
Member

Choose a reason for hiding this comment

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

idention and apt-get instead of apt

$STD apt-get install -y \
  sudo \
  ...
  ...
  ...

msg_info "Installing VictoriaMetrics"
RELEASE=$(curl -s https://api.github.com/repos/VictoriaMetrics/VictoriaMetrics/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
mkdir -p {/etc/victoriametrics,/var/lib/victoriametrics,/opt/victoriametrics}

Copy link
Member

Choose a reason for hiding this comment

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

remove blank line


msg_info "Installing VictoriaMetrics"
RELEASE=$(curl -s https://api.github.com/repos/VictoriaMetrics/VictoriaMetrics/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
mkdir -p {/etc/victoriametrics,/var/lib/victoriametrics,/opt/victoriametrics}
Copy link
Member

Choose a reason for hiding this comment

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

/var/lib... not needed?

Comment on lines +49 to +51
Description=VictoriaMetrics is a fast, cost-effective and scalable monitoring solution and time series database.
# https://docs.victoriametrics.com
# See https://docs.victoriametrics.com/#list-of-command-line-flags to get more information about supported command-line flags
Copy link
Member

Choose a reason for hiding this comment

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

remove this 3 lines

-opentsdbListenAddr=:4242 \
-influxListenAddr=:8089 \
-enableTCP6

Copy link
Member

Choose a reason for hiding this comment

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

remove blank line

rm -rf victoria-metrics-linux-amd64-${RELEASE}.tar.gz
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP} to ${RELEASE}"

Copy link
Member

Choose a reason for hiding this comment

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

add before Service Startup:

msg_info "Cleaning up"
rm -rf  PathFile
msg_ok "Cleaned"

@MickLesk
Copy link
Member

Have you given up? ^^ The script was almost finished, just a bit of fine-tuning. @denisgolius

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new script A change that adds a new script website A change to the website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants