Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
92d3fff6e1 | |||
548dc03a78 | |||
9c12e3d800 |
3 changed files with 14 additions and 9 deletions
13
README.md
13
README.md
|
@ -1,7 +1,12 @@
|
|||
<center>
|
||||
|
||||
# Netweak Agent
|
||||
|
||||
[![netweak.com](https://netweak.com/img/logo/256h/logo-dark.png)](https://netweak.com)
|
||||
|
||||
Netweak provides simple linux server monitoring. [Create a free account](https://netweak.com/register)
|
||||
|
||||
Netweak provides simple linux server monitoring. [Create a free account](https://netweak.com/register).
|
||||
The Netweak agent sends monitoring data from your linux server to our API on a regular basis.
|
||||
|
||||
___
|
||||
|
||||
This fork of Netweak Agent is built for the unofficial Docker Image for Netweak Agent.
|
||||
|
||||
</center>
|
4
agent.sh
4
agent.sh
|
@ -99,8 +99,8 @@ i*86)
|
|||
esac
|
||||
|
||||
# CPU details
|
||||
cpu_name=$(prep "$(cat /proc/cpuinfo | grep 'model name' | awk -F\: '{ print $2 }')")
|
||||
cpu_cores=$(prep "$(($(cat /proc/cpuinfo | grep 'model name' | awk -F\: '{ print $2 }' | sed -e :a -e '$!N;s/\n/\|/;ta' | tr -cd \| | wc -c)+1))")
|
||||
cpu_name=$(env | grep CPU_NAME | grep -oe '[^=]*$');
|
||||
cpu_cores=$(env | grep CPU_CORE | grep -oe '[^=]*$');
|
||||
|
||||
if [ -z "$cpu_name" ]
|
||||
then
|
||||
|
|
|
@ -119,13 +119,13 @@ mkdir -p /etc/netweak
|
|||
mkdir -p /etc/netweak/log
|
||||
|
||||
# Download agent
|
||||
echo -e "| Downloading agent.sh to /etc/netweak\n|\n| + $(curl -JLso /etc/netweak/agent.sh https://github.com/netweak/agent/raw/main/agent.sh)"
|
||||
echo -e "| Downloading heartbeat.sh to /etc/netweak\n|\n| + $(curl -JLso /etc/netweak/heartbeat.sh https://github.com/netweak/agent/raw/main/heartbeat.sh)"
|
||||
echo -e "| Downloading agent.sh to /etc/netweak\n|\n| + $(curl -JLso /etc/netweak/agent.sh https://ark.sudovanilla.org/Korbs/netweak-agent/raw/branch/main/agent.sh)"
|
||||
echo -e "| Downloading heartbeat.sh to /etc/netweak\n|\n| + $(curl -JLso /etc/netweak/heartbeat.sh https://ark.sudovanilla.org/Korbs/netweak-agent/raw/branch/main/heartbeat.sh)"
|
||||
|
||||
if [ -f /etc/netweak/agent.sh ]
|
||||
then
|
||||
# Create auth file
|
||||
echo "$1" > /etc/netweak/token.conf
|
||||
echo $(env | grep TOKEN | grep -oe '[^=]*$'); > /etc/netweak/token.conf
|
||||
|
||||
# Create user
|
||||
useradd netweak -r -d /etc/netweak -s /bin/false
|
||||
|
|
Loading…
Reference in a new issue