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

build script for opnsense #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions build_on_opnsense.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh

# as root
pkg install gmake
pkg install automake
pkg install fping

# create smokeping user and su to smokeping user

curl -L --output smokeping-2.8.0pre.tar.gz https://github.com/prunux/SmokePing/archive/refs/tags/2.8.0pre.zip

curl -L --output add_lwp_protocol_https_thirdparty.patch https://github.com/prunux/SmokePing/pull/1.patch
curl -L --output fix_paranthesis_lib_smokeping.patch https://github.com/prunux/SmokePing/pull/2.patch

tar xzf smokeping-2.8.0pre.tar.gz
cd Smokeping-2.8.0pre

patch -p1 < ../add_lwp_protocol_https_thirdparty.patch
patch -p1 < ../fix_paranthesis_lib_smokeping.patch

# rebuild automconfigure and automake system
autoreconf -install --verbose --make

# install to user folder
./configure --prefix=$HOME/opt/smokeping-2.8.0pre
gmake
gmake install
34 changes: 34 additions & 0 deletions run_smokeping_on_opnsense.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

#############
MASTER Config
#############
# Configure Master to run Smokeping on OpnSense Slave

# File: /etc/smokeping/config.d/Slaves

+opnsense
display_name=opnsense
location=Inline
color=ff8080
++override
Probes.FPing.binary = /usr/local/sbin/fping

###########################
RUN SMOKEPING IN SLAVE MODE
###########################

# run smokeping as user on opnsense box in slave mode

echo "myverysecret" > $HOME/opt/smokeping/etc/slavesecret
chmod 0600 $HOME/opt/smokeping/etc/slavesecret

mkdir -p $HOME/opt/smokeping/var/lib/smokeping
mkdir -p $HOME/opt/smokeping/var/run/smokeping

cd $HOME/opt/smokeping/bin
./smokeping \
--master-url=https://my.smokeping.master.host.example.com:443 \
--shared-secret=../etc/slavesecret \
--slave-name=opnsense-slave \
--cache-dir=../var/lib/smokeping \
--pid-dir=../var/run/smokeping