-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from mnellemann/packaging
Packaging
- Loading branch information
Showing
30 changed files
with
431 additions
and
210 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
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
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
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
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 @@ | ||
# Instruction for Linux | ||
|
||
Please note that the software versions referenced in this document might have changed and might not be available/working unless updated. | ||
|
||
More details are available in the [README.md](../README.md) file. | ||
|
||
|
||
## Requirements | ||
|
||
Java 8 (or later) runtime is required. | ||
|
||
## Installation | ||
|
||
[Download](https://github.com/mnellemann/sysmon/releases) the latest client and plugins rpm or deb files. | ||
|
||
### RedHat Linux | ||
|
||
```shell | ||
sudo dnf install java-11-openjdk-headless | ||
sudo rpm -ivh sysmon-client-*.noarch.rpm sysmon-plugins-*.rpm | ||
``` | ||
|
||
Use *yum* if *dnf* is not available. | ||
|
||
### SUSE Linux | ||
|
||
```shell | ||
sudo zypper install java-11-openjdk-headless | ||
sudo zypper install sysmon-client-*.noarch.rpm sysmon-plugins-*.rpm | ||
``` | ||
|
||
### Debian/Ubuntu Linux | ||
|
||
```shell | ||
sudo apt install default-jre-headless | ||
sudo dpkg -i sysmon-client-*.deb sysmon-plugins-*.deb | ||
``` | ||
|
||
## Configuration | ||
|
||
Edit **/etc/sysmon-client.toml** and modify the server URL. | ||
|
||
Check logs for errors with: ```journalctl -u sysmon-client``` |
This file was deleted.
Oops, something went wrong.
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
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,49 @@ | ||
#!/bin/sh | ||
|
||
install_config() { | ||
test -f "/etc/${service_name}.toml" || cp "${config_source}" "/etc/${service_name}.toml" | ||
} | ||
|
||
install_systemd() { | ||
sysctl=$(command -v deb-systemd-invoke || echo systemctl) | ||
test -f "/etc/systemd/system/${service_name}.service" || cp "${systemd_source}" "/etc/systemd/system/${service_name}.service" | ||
$sysctl --system daemon-reload >/dev/null || true | ||
if ! $sysctl is-enabled ${service_name} >/dev/null | ||
then | ||
$sysctl enable ${service_name} >/dev/null || true | ||
$sysctl start ${service_name} >/dev/null || true | ||
else | ||
$sysctl restart ${service_name} >/dev/null || true | ||
fi | ||
} | ||
|
||
install_sysv_linux() { | ||
echo "WARN: No support for ${service_name} on SysV Linux" | ||
} | ||
|
||
install_sysv_aix() { | ||
test -f "/etc/rc.d/init.d/${service_name}" || cp "${sysv_source}" "/etc/rc.d/init.d/${service_name}" | ||
chmod 0755 "/etc/rc.d/init.d/${service_name}" | ||
ln -sf /etc/rc.d/init.d/sysmon-client /etc/rc.d/rc2.d/Ssysmon-client | ||
ln -sf /etc/rc.d/init.d/sysmon-client /etc/rc.d/rc2.d/Ksysmon-client | ||
} | ||
|
||
install_sysv() { | ||
if [ x$(uname | grep AIX) = x"" ]; then | ||
install_sysv_linux | ||
else | ||
install_sysv_aix | ||
fi | ||
} | ||
|
||
# Install configuration file | ||
install_config | ||
|
||
# Detect if we are running on a systemd based Linux | ||
if [ x$(command -v systemctl) = x"" ]; then | ||
install_sysv | ||
else | ||
install_systemd | ||
fi | ||
|
||
exit 0 |
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,44 @@ | ||
#!/bin/sh | ||
|
||
remove_config() { | ||
echo "Leaving /etc/${service_name}.toml for manual deletion." | ||
#test -f "/etc/${service_name}.toml" && mv "/etc/${service_name}.toml" "/etc/${service_name}.bak" | ||
} | ||
|
||
remove_systemd() { | ||
sysctl=$(command -v deb-systemd-invoke || echo systemctl) | ||
$sysctl stop ${service_name} >/dev/null || true | ||
$sysctl disable ${service_name} >/dev/null || true | ||
test -f "/etc/systemd/system/${service_name}.service" && rm -f "/etc/systemd/system/${service_name}.service" | ||
$sysctl --system daemon-reload >/dev/null || true | ||
} | ||
|
||
remove_sysv_linux() { | ||
echo "WARN: No support for ${service_name} on SysV Linux" | ||
} | ||
|
||
remove_sysv_aix() { | ||
/etc/rc.d/init.d/${service_name} stop | ||
rm -f /etc/rc.d/init.d/sysmon-client /etc/rc.d/rc2.d/Ksysmon-client | ||
rm -f /etc/rc.d/rc2.d/Ssysmon-client | ||
} | ||
|
||
remove_sysv() { | ||
if [ x$(uname | grep AIX) = x"" ]; then | ||
remove_sysv_linux | ||
else | ||
remove_sysv_aix | ||
fi | ||
} | ||
|
||
# Remove configuration file | ||
remove_config | ||
|
||
# Detect if we are running on a systemd based Linux | ||
if [ x$(command -v systemctl) = x"" ]; then | ||
remove_sysv | ||
else | ||
remove_systemd | ||
fi | ||
|
||
exit 0 |
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,7 @@ | ||
#!/bin/sh | ||
|
||
service_name="sysmon-client" | ||
sysv_source="/opt/sysmon/client/doc/sysmon-client.sh" | ||
config_source="/opt/sysmon/client/doc/sysmon-client.toml" | ||
systemd_source="/opt/sysmon/client/doc/sysmon-client.service" | ||
|
Oops, something went wrong.