forked from NIXStats/nixstatsagent
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Agent360-Build-Packages | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
build-debian: | ||
# needs: tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Copy source files | ||
run: mkdir -p packager/debian/usr/bin; cp -r agent360 packager/debian/usr/bin/agent360 | ||
- name: Build debian package | ||
run: dpkg-deb --build packager/debian dist/agent360.deb | ||
- name: Install debian package | ||
run: dpkg -i dist/agent360.deb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Unit] | ||
Description=360monitoring agent | ||
After=network.target | ||
|
||
[Service] | ||
ExecStart=/usr/bin/agent360/agent360.py | ||
Restart=always | ||
User=agent360 | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh -e | ||
|
||
. /usr/share/debconf/confmodule | ||
|
||
db_input high agent360/user || : | ||
db_go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Version: 1.3.1 | ||
Source: agent360 | ||
Section: net | ||
Priority: extra | ||
Maintainer: 360 monitoring <[email protected]> | ||
Build-Depends: debhelper (>=9), | ||
python-all | ||
Standards-Version: 3.9.5 | ||
Homepage: https://github.com/plesk/agent360 | ||
X-Python-Version: >= 2.6 | ||
Package: agent360 | ||
Architecture: amd64 | ||
Multi-Arch: foreign | ||
Description: 360monitoring agent | ||
360monitoring.com offers a web service of monitoring and displaying | ||
your server performance statistics. | ||
. | ||
This software is an OS-agnostic agent. | ||
It’s been optimized to have a very small CPU footprint and comes with | ||
an extendable set of useful plugins. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/sh -e | ||
|
||
. /usr/share/debconf/confmodule | ||
|
||
TOKEN=/etc/agent360-token.ini | ||
|
||
db_get agent360/user | ||
[ -n "$RET" ] && USERID="$RET" | ||
|
||
|
||
if [ -n "$USERID" ]; then | ||
agent360 hello $USERID /etc/agent360-token.ini | ||
else | ||
echo 'Generic "hello" is not implemented' | ||
fi | ||
|
||
if which pycompile >/dev/null 2>&1; then | ||
pycompile -p agent360 | ||
fi | ||
|
||
if [ "$(grep -c '^agent360:' /etc/passwd)" = "0" ]; then | ||
echo "Creating user and group agent360" | ||
addgroup --quiet --system agent360 && adduser --quiet --system --disabled-password --no-create-home --gecos "agent360 daemon" --group agent360 | ||
else | ||
echo "User creation skipped, user is already present" | ||
fi | ||
|
||
deb-systemd-helper unmask agent360.service >/dev/null || true | ||
|
||
if deb-systemd-helper --quiet was-enabled agent360.service; then | ||
# Enables the unit on first installation, creates new | ||
# symlinks on upgrades if the unit file has changed. | ||
deb-systemd-helper enable agent360.service >/dev/null || true | ||
else | ||
# Update the state file to add new symlinks (if any), which need to be | ||
# cleaned up on purge. Also remove old symlinks. | ||
deb-systemd-helper update-state agent360.service >/dev/null || true | ||
fi | ||
|
||
if [ -d /run/systemd/system ]; then | ||
systemctl --system daemon-reload >/dev/null || true | ||
deb-systemd-invoke start agent360.service >/dev/null || true | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh -e | ||
|
||
case "$1" in | ||
install|upgrade) | ||
touch /var/log/agent360.log && chmod a+w /var/log/agent360.log | ||
;; | ||
*) | ||
;; | ||
esac |