OK, I got it working using the proper agent. :)
Thanks for the support!
OK, I got it working using the proper agent. :)
Thanks for the support!
Also, I'm running this on a Pine64 RockPro64, 64-bit ARM platform. And I'm trying to run your Linux Debian 7 script.
scott@rockpro:~$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux bullseye/sid"
NAME="Debian GNU/Linux"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
scott@rockpro:~$ uname -r
5.10.0-4-arm64
scott@rockpro:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux bullseye/sid
Release: testing
Codename: bullseye
scott@rockpro:~$ lsb_release -d
Description: Debian GNU/Linux bullseye/sid
scott@rockpro:~$ hostnamectl
Static hostname: rockpro
Icon name: computer
Machine ID: b4c2b6335c05427290bd2213cb9dd2ac
Boot ID: 1f307ff6a0b344efa95baf617efad53d
Operating System: Debian GNU/Linux bullseye/sid
Kernel: Linux 5.10.0-4-arm64
Architecture: arm64
Here, this is a better view.
root@rockpro:/otm# ls -la
total 184
drwxr-xr-x 2 root root 4096 Mar 13 15:11 .
drwxr-xr-x 19 root root 4096 Mar 12 17:42 ..
-rw-r–r-- 1 root root 193 Mar 13 15:11 otminfo.log
-rwxr-xr-x 1 root root 166024 Mar 13 15:11 otm_linux
-rwxr-xr-x 1 root root 2366 Mar 12 18:25 starter_linux_ocp1.sh
-rwxr-xr-x 1 root root 2332 Mar 12 17:48 starter_linux_ocp.sh
Here are the contents of /otm
sapeters@rockpro:/otm$ ls
otminfo.log otm_linux starter_linux_ocp1.sh starter_linux_ocp.sh
The other .sh is one I edited using the actual credentials for the curl instead of the variables for user/pw, but got same results. (As mentioned before, if I execute curl from the prompt, it is successful.
root@rockpro:/otm# ./starter_linux_ocp1.sh
Make sure to create /etc/agentid with credentials before starting this script
Make sure your starter file points to the same directory that you have it in - Edit the 'start' option above accordingly
You could add this to /etc/rc.local to start it or build a service for it. Please search Google for more.
Receiving binary location
Getting the OTM Package
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 162k 0 0 0 0 0 0 –:--:-- --:--:-- --:--:-- 0
Downloading OTM
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 162k 100 162k 0 0 415k 0 --:--:-- --:--:-- --:--:-- 414k
OTM downloaded, starting program then exiting this script
./starter_linux_ocp1.sh: line 56: /otm/otm_linux: cannot execute binary file: Exec format error
Something didn't work, your agent is not running.
root@rockpro:/otm#
I'm having some trouble with the Linux agent installation. Similar problem as another in the forums.
I am also able to do a curl if I use the credentials.
root@rockpro:/otm# curl -m 20 -s -u (user:pw) --connect-timeout 10 -X POST https://www.foxymon.com/receiver/receiver2.php -F function=receive_binary_location
https://downloads.outagesio.com/otm/otm_1.67.2104_linuxroot@rockpro:/otm#
root@rockpro:/otm#
root@rockpro:/otm#
root@rockpro:/otm#
root@rockpro:/otm#
root@rockpro:/otm#
root@rockpro:/otm# curl -v -m 20 -s -u user:password--connect-timeout 10 -X POST https://www.foxymon.com/receiver/receiver2.php -F function=receive_binary_location
Trying 184.164.141.219:443...
Connected to www.foxymon.com (184.164.141.219) port 443 (#0)
ALPN, offering h2
ALPN, offering http/1.1
successfully set certificate verify locations:
CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
TLSv1.3 (OUT), TLS handshake, Client hello (1):
TLSv1.3 (IN), TLS handshake, Server hello (2):
TLSv1.2 (IN), TLS handshake, Certificate (11):
TLSv1.2 (IN), TLS handshake, Server key exchange (12):
TLSv1.2 (IN), TLS handshake, Server finished (14):
TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
TLSv1.2 (OUT), TLS handshake, Finished (20):
TLSv1.2 (IN), TLS handshake, Finished (20):
SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
ALPN, server accepted to use http/1.1
Server certificate:
subject: CN=foxymon.com
start date: Feb 8 16:10:48 2021 GMT
expire date: May 9 16:10:48 2021 GMT
subjectAltName: host "www.foxymon.com" matched cert's "www.foxymon.com"
issuer: C=US; O=Let's Encrypt; CN=R3
SSL certificate verify ok.
Server auth using Basic with user 'l1UxzvwhBu'
POST /receiver/receiver2.php HTTP/1.1
Host: www.foxymon.com
Authorization: Basic bDFVeHp2d2hCdTpSYXVoRHhyMWpOc25jWlV5bHpBTU81R2Jwb0ZxM2dUN0JtVzh2WGVW
User-Agent: curl/7.74.0
Accept: /
Content-Length: 166
Content-Type: multipart/form-data; boundary=------------------------f0db9c60c65555e9
We are completely uploaded and fine
Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Date: Sat, 13 Mar 2021 02:44:08 GMT
< Server: Apache
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate
< Pragma: no-cache
< Set-Cookie: advanced-backend=uiof82q8o8qra1kom7dkthq5l7; path=/; HttpOnly
< Set-Cookie: _identity-backend=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; HttpOnly
< Set-Cookie: _csrf-backend=bc4b70b337f447cbcee2acd528e9e2c25a2dfac79b5f26214ae166aef4a15464a%3A2%3A%7Bi%3A0%3Bs%3A13%3A%22_csrf-backend%22%3Bi%3A1%3Bs%3A32%3A%22690h-JTA5QuveoK5TrJ2D46V2-45jtxW%22%3B%7D; path=/; HttpOnly
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=UTF-8
<
https://downloads.outagesio.com/otm/otm_1.67.2104_linuxroot@rockpro:/otm#
Here's my error:
root@rockpro:/otm# ./starter_linux_ocp.sh
Make sure to create /etc/agentid with credentials before starting this script
Make sure your starter file points to the same directory that you have it in - Edit the 'start' option above accordingly
You could add this to /etc/rc.local to start it or build a service for it. Please search Google for more.
Receiving binary location
Getting the OTM Package
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 162k 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
Downloading OTM
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 162k 100 162k 0 0 382k 0 --:--:-- --:--:-- --:--:-- 383k
OTM downloaded, starting program then exiting this script
./starter_linux_ocp.sh: line 56: /otm/otm_linux: cannot execute binary file: Exec format error
Something didn't work, your agent is not running.
root@rockpro:/otm#
agentid has only the 2 lines, no extra spaces or line breaks. My script is in /otm/starter_linux_ocp.sh
root@rockpro:/otm# cat starter_linux_ocp.sh
#!/bin/bash
#Version 1.0.3
start="/otm"
command -v curl >/dev/null 2>&1 || { echo >&2 "The curl package is needed but not installed. Please install it and try again. Aborting."; exit 1; }
echo ""
echo "Make sure to create /etc/agentid with credentials before starting this script"
echo "Make sure your starter file points to the same directory that you have it in - Edit the 'start' option above accordingly"
echo "You could add this to /etc/rc.local to start it or build a service for it. Please search Google for more."
echo ""
sleep 5
OTMIN="otm"
IN="$start/updater_linux_ocp.sh"
DATE=date +%d-%m-%y
OTM_COMMAND="otm_linux"
USERNAME=awk 'NR==1' /etc/agentid
PASSWORD=awk 'NR==2' /etc/agentid
rm -f $start/otm_linux
OTM_HTTP_STATUS=''
OTM_REMOTE_LENGTH=''
until [[ ${OTM_HTTP_STATUS} -eq 200 && ! -z ${OTM_REMOTE_LENGTH} ]]
do
sleep 5
echo "Receiving binary location"
BINARY_LOCATION=$(curl -m 20 -s -u $USERNAME:$PASSWORD –connect-timeout 10 -X POST https://www.foxymon.com/receiver/receiver2.php -F function=receive_binary_location)
echo "Getting the OTM Package"
curl -I -m 30 --connect-timeout 15 "$BINARY_LOCATION" -o $start/otminfo.log
OTM_HTTP_STATUS=$(cat $start/otminfo.log | awk '/HTTP/ {print $2}')
OTM_REMOTE_LENGTH=$( cat $start/otminfo.log | awk '/Content-Length/ {print $2}' | sed -e 's/[\r\n]//g' )
done
if [[ ${OTM_HTTP_STATUS} -eq 200 && ! -z ${OTM_REMOTE_LENGTH} ]]; then
echo "Downloading OTM"
curl -m 30 –connect-timeout 15 "$BINARY_LOCATION" -o $start/otm_linux
sleep 2
OTM_LOCAL_LENGTH=$( ls -l $start/otm_linux | awk '{print $5}' | sed -e 's/[\r\n]//g' )
if [ "${OTM_LOCAL_LENGTH}" == "${OTM_REMOTE_LENGTH}" ]; then
echo "OTM downloaded, starting program then exiting this script"
cd $start
chmod +x $start/otm_linux
$start/otm_linux &
ps cax | grep otm_linux > /dev/null
if [ $? -eq 0 ]; then
echo ""
echo "Congratulations, your agent is now monitoring your Internet connectivity."
echo "Type 'ps cax | grep otm_linux' to see the process number"
else
echo "Something didn't work, your agent is not running."
fi
fi
fi
root@rockpro:/otm#</user:password>