Monitor your Internet service and provider

    Information and Support

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. PJPorch

    Information, Support and FAQ forums for OutagesIO

    Our FREE software monitors your Internet service and provider and can alert you to connection issues or downtime. For home, small business, IT companies and enterprise. Monitor Internet outages, track network connection reliability, and get proof you can use. For Windows 7, 8, 10, Centos 7, 8, Debian 7, Ubuntu, ARM (Raspberry, Tinker Board, etc).

    Learn more about www.outagesio.com by visiting our web site

    P
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 12
    • Best 1
    • Controversial 0
    • Groups 0

    PJPorch

    @PJPorch

    1
    Reputation
    1
    Profile views
    12
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    PJPorch Unfollow Follow

    Best posts made by PJPorch

    • RE: SOLVED: Install infinite loop

      @OutagesIO_Support Below is the script and output from the otminfo.log file.

      • The only change to the script is the start variable at the top
      • In the folder "/home/josh/agent" I have this script and the otminfo.log file.
      • I can give you the agent ID if needed.

      OTMinfo.log

      HTTP/2 200
      date: Wed, 09 Mar 2022 01:12:16 GMT
      server: Apache
      strict-transport-security: max-age=63072000; includeSubDomains
      last-modified: Thu, 11 Feb 2021 12:34:03 GMT
      etag: "28888-5bb0ebc1544c0"
      accept-ranges: bytes
      content-length: 166024
      vary: User-Agent
      content-security-policy: frame-ancestors 'none';
      content-secure-policy: default-src 'self';
      x-xss-protection: 1; mode=block
      x-frame-options: SAMEORIGIN
      x-content-type-options: nosniff
      referrer-policy: same-origin
      permissions-policy: fullscreen=(self 'https://app.outagesio.com'),geolocation=*, camera=()
      

      Script

      #!/bin/bash
      
      #Version 1.0.3
      
      # Enter the full path where you will be placing the starter_linux_otm.sh script into.
      # Our example shows '/agent', change this to what ever your path is.
      start="/home/josh/agent"
      
      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
      
      ### Define Global Variables
      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`
      
      ### OTM section
      # Get rid of any old version
      rm -f $start/otm_linux
      OTM_HTTP_STATUS=''
      OTM_REMOTE_LENGTH=''
      
      ### Loop
      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
      ## exec $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
      
      posted in ARM
      P
      PJPorch

    Latest posts made by PJPorch

    • RE: SOLVED: Install infinite loop

      @OutagesIO_Support Thank you. I appreciate the time it took to troubleshoot this one with me.

      posted in ARM
      P
      PJPorch
    • RE: SOLVED: Install infinite loop

      @OutagesIO_Support The new agent is 128834. This was the site with all the issues that seems to be running well now.

      Agent 128600 can be deleted.

      posted in ARM
      P
      PJPorch
    • RE: SOLVED: Install infinite loop

      @EchoMin
      Whatever changes you made to the script seems to have fixed it. I deleted everything, reinstalled with the new scripts, and everything seems to be downloading and running properly.

      Thanks for all the help.
      Josh

      posted in ARM
      P
      PJPorch
    • RE: SOLVED: Install infinite loop

      @OutagesIO_Support

      • Disabled the service
      • Killed all running processes
      • Agent shows as "Inactive"
      • Edited the script to run manually.
      # exec $start/otm_linux &
      $start/otm_linux &
      
      • Run the script manually and I'm right back at the beginning where it won't download the file. There are no apparent errors with credentials, permission to download the file, or anything indicating why it can't download the file.

      b68ebf3d-385e-47e5-8aab-5345f3a9dbe5-image.png

      posted in ARM
      P
      PJPorch
    • RE: SOLVED: Install infinite loop

      @OutagesIO_Support
      Sorry...I guess I was jumping ahead when you said you showed the agent as active.

      I have stopped the service from running.

      sudo service otm status
      

      4803f4b9-a1a4-4e14-a21d-ccc7127b818d-image.png

      If I search for the running process with your script I get nothing.

      ps cax | grep otm_linux
      

      b289daaf-f78f-4164-bf8a-f25709f4be3b-image.png

      If I search for the name of the script I do get some results, so I manually have killed all processes running the script,

      ps -aux | grep 'starter_linux_ocp'
      

      f07c0bc7-50f3-4013-b5bf-34186b497024-image.png

      When I run the curl command with my credentials I get a response of
      "https://downloads.outagesio.com/otm/otm_1.67.2104_linux" which looks like it exactly matches the URL I was able to manually download from, so that part of the script seems to be working correctly.

      posted in ARM
      P
      PJPorch
    • RE: SOLVED: Install infinite loop

      @OutagesIO_Support

      • Nothing is being populated in the ping field or recent events.
      • The public IP is not updated to the correct address.
      • The service on the Ubuntu machine shows it is running, but I cannot tell if it was able to download the agent or not. Manually downloading might have helped this get started.

      55b6bf7f-e099-46e4-bc79-3e119cf279d6-image.png

      posted in ARM
      P
      PJPorch
    • RE: SOLVED: Install infinite loop

      @OutagesIO_Support
      Agent 128588 is working without any issues.
      This post is regarding Agent 128600.
      The 3rd must have been one I created during testing then deleted.

      posted in ARM
      P
      PJPorch
    • RE: SOLVED: Install infinite loop

      @PJPorch In looking at the script I notice the URL you gave to directly download the file is from outagesio.com, but the script goes to foxymon.com. Could there be an issue with this foxymon.com URL?

      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)
      
      posted in ARM
      P
      PJPorch
    • RE: SOLVED: Install infinite loop

      @OutagesIO_Support Both the HTTP & HTTPS links successfully download the file. I am able to get the version following your commands as well.

      a2bf31b7-5b37-4a5c-bdb2-e8f04d83e8f2-image.png

      posted in ARM
      P
      PJPorch
    • RE: SOLVED: Install infinite loop

      @OutagesIO_Support This is installed on an Ubuntu server, so I am using the linux script. The reason I posted here is I am seeing the exact same issue where it keeps trying to download the otm_linux binary and can never successfully do it. I can repost to the Linux section if required. I was just thinking the symptoms are identical, so the solution might be the same.

      I have also tried to disable the service, adjust the script as below, and then run in manually (screenshot). I get the same result where it loops trying to download the file.

      Script when service is enabled:

      ## exec $start/otm_linux &
      #$start/otm_linux &
      

      Script when service is disabled and the script is run manually:

      # exec $start/otm_linux &
      $start/otm_linux &
      

      Here is my service file. Located at: /etc/systemd/system/otm.service

      [Unit]
      Description=Startup of the OutagesIO monitoring agent
      
      [Install]
      WantedBy=multi-user.target
      
      After=network.target
      
      [Service]
      Type=simple
      ExecStartPre=/home/josh/agent/starter_linux_ocp.sh
      ExecStart=/home/josh/agent/otm_linux
      WorkingDirectory=/home/josh/agent
      Restart=always
      RestartSec=5
      StandardOutput=syslog
      StandardError=syslog
      SyslogIdentifier=%n
      

      Results when running the script directly.
      cfc3bb75-0540-4bfd-a1bd-65f62c9a8b0f-image.png

      posted in ARM
      P
      PJPorch