Start Agent on Boot - FreeBSD

Here's a quick guide to ensure your v1 agent starts when your FreeBSD system boots up. We assume nano is your text editor and that the sd-agent files are located at /etc/sd-agent in this tutorial.

This article is for our v1 agent and will soon be deprecated.

Download and install the agent by following these instructions

Install python

sudo pkg install python

Create rc.d file

sudo nano /usr/local/etc/rc.d/sdagent

And paste the following into the file

#!/bin/sh
# 

# PROVIDE: sdagent
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown

. /etc/rc.subr

name="sdagent"
rcvar=`set_rcvar`

: ${sdagent_enable="NO"}

start_cmd="sd_start"
stop_cmd="sd_stop"

sd_start()
{
	usr/local/bin/python /etc/sd-agent/agent.py restart
}
sd_stop()
{
	usr/local/bin/python /etc/sd-agent/agent.py stop
}

load_rc_config $name
run_rc_command "$1"

Allow execution 

sudo chmod +x /etc/sd-agent/agent.py
sudo chmod +x /usr/local/etc/rc.d/sdagent

Edit /etc/rc.conf

sudo nano /etc/rc.conf

and append the following

sdagent_enable="YES"

Reboot

sudo reboot

Once the server is back online, head back to your UI to see the metrics

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Monday  —  Friday.

10am  —  6pm UK.

Dedicated Support.