Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Monitor your Internet service and provider

Information and Support

  1. Home
  2. Categories
  3. Support forums
  4. Linux
  5. New script isn't working
Automatically monitor your Internet service and provider with alerts to problems
Track Internet disconnections, provider outages with historical data, and automated speed testing.
For Windows, Linux, ARM64, ARMa7. Learn more by visiting www.outagesio.com
Notice: If you created an account on app.outagesio.com, simply use the same credentials to log in here.

New script isn't working

Scheduled Pinned Locked Moved Solved Linux
linuxreleaseubuntu
18 Posts 3 Posters 1.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cwa
    wrote on last edited by OutagesIO_Support
    #1

    It prints an error over and over again, complaining about a url.

    Help!

    Thanks,

    Cwa

    OutagesIO_SupportO 1 Reply Last reply
    1
    • C cwa

      It prints an error over and over again, complaining about a url.

      Help!

      Thanks,

      Cwa

      OutagesIO_SupportO Offline
      OutagesIO_SupportO Offline
      OutagesIO_Support
      wrote on last edited by OutagesIO_Support
      #2

      @cwa

      Hi, could you share more details please like operating system, steps you took, screen shots, anything that would help me to diagnose this with you.

      I created a new agent for centos-8.
      Downloaded the script into a new directory called /otm.
      I chmod it 755.
      I ran it and it worked.

      $ chmod 755 starter.sh
      $ ./starter.sh

      Make sure to create /etc/agentid with credentials before starting this script
      Make sure this script points to the same directory that you have it in - Edit the 'STARTING_FOLDER' variable in this script 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 994k 0 --:--:-- --:--:-- --:--:-- 994k
      OTM downloaded, starting program then exiting this script
      If using systemd to start the agent, please be sure to comment out this line below, /otm/otm_binary &

      Congratulations, your agent is now monitoring your Internet connectivity.
      Type 'ps cax | grep otm_binary' to see the process number
      [root@dev50 otm]# ps cax | grep otm_binary
      21185 pts/0 Sl 0:00 otm_binary

      $ kill 21185
      $ more starter.sh

      #!/bin/bash

      #Version 1.0.5

      Regards,
      OutagesIO Support

      Search engines favor deep pockets making it difficult to find services like OutagesIO.
      To help us, you could leave a Google review, or share your reports in forums, or social media.
      You could mention us in articles, and perhaps someone would review us.
      We count on satisfied members spreading the word!

      1 Reply Last reply
      0
      • C Offline
        C Offline
        cwa
        wrote on last edited by
        #3

        My original post had all of the information you are asking for, with several code snips, and 2 screen shots. Every time I tried to post, the post was denied. I kept simplifying the post until all that was left was a vanilla version .

        I'll try again, please stand by.

        cwa

        OutagesIO_SupportO 1 Reply Last reply
        0
        • C cwa

          My original post had all of the information you are asking for, with several code snips, and 2 screen shots. Every time I tried to post, the post was denied. I kept simplifying the post until all that was left was a vanilla version .

          I'll try again, please stand by.

          cwa

          OutagesIO_SupportO Offline
          OutagesIO_SupportO Offline
          OutagesIO_Support
          wrote on last edited by OutagesIO_Support
          #4

          @cwa

          Yes, sorry about that, it's probably the board filtering. I've enabled your full access now so you should be ok.

          First posts are always filtered otherwise we would be inundated with spam of course.

          Regards,
          OutagesIO Support

          Search engines favor deep pockets making it difficult to find services like OutagesIO.
          To help us, you could leave a Google review, or share your reports in forums, or social media.
          You could mention us in articles, and perhaps someone would review us.
          We count on satisfied members spreading the word!

          C 1 Reply Last reply
          0
          • OutagesIO_SupportO OutagesIO_Support

            @cwa

            Yes, sorry about that, it's probably the board filtering. I've enabled your full access now so you should be ok.

            First posts are always filtered otherwise we would be inundated with spam of course.

            C Offline
            C Offline
            cwa
            wrote on last edited by
            #5

            @OutagesIO_Support
            Thanks for letting me know about the filtering! That was really frustrating but now I understand.

            I followed the instructions in this document: https://www.outagesio.com/monitor-your-internet-with-ubuntu-desktop-or-server/

            I entered 'comcast' as my ISP (whom I am not in love with).
            Entered my address, and then created an agent. I think I chose Ubuntu.
            I downloaded the script, and first used a new directory in my home dir. When that didn't work, I followed the article's instructions exactly and created /otm.
            I ran chmod 777 on it, and copied the script in with 755 permission. I didn't change anything in the script since I was using the folder it expected. I created /etc/agentid with the credentials, then ran the script.
            It first complained a log file was not present. I created the file "otminfo.log" manually, an ran the script again. It is stuck in a loop repeating this error message:
            "Receiving binary location
            Getting the OTM Package
            curl: (3) URL using bad/illegal format or missing URL
            Receiving binary location
            Getting the OTM Package
            curl: (3) URL using bad/illegal format or missing URL"

            Here's a screenshot, maybe it will help:
            terminal 2022-04-02 17-59-49.png

            And here's what the script is printing:
            terminal 2022-04-02 18-08-23.png

            Let me know what you discover!

            Thanks,

            cwa

            1 Reply Last reply
            0
            • C Offline
              C Offline
              cwa
              wrote on last edited by
              #6

              Oh yeah, a couple more things. I can browse to the URL shown in the script and can log in successfully with my credentials.

              Also, I can verify the script is reading my credentials from /etc/angentid correctly (I used "echo...." in the script).

              cwa

              OutagesIO_SupportO 1 Reply Last reply
              0
              • C cwa

                Oh yeah, a couple more things. I can browse to the URL shown in the script and can log in successfully with my credentials.

                Also, I can verify the script is reading my credentials from /etc/angentid correctly (I used "echo...." in the script).

                cwa

                OutagesIO_SupportO Offline
                OutagesIO_SupportO Offline
                OutagesIO_Support
                wrote on last edited by
                #7

                Interesting since you're running 1.0.5 which is the latest and I just tested it with success.

                First, do not delete the otminfo.log manually as the script needs it to complete it's steps, which is to confirm that the program was downloaded.

                Just for reference and maybe you can see something different, this is what the steps are on the installation page itself.

                STEPS
                Now that you have downloaded the script and have the keys, please follow these steps:
                
                1. Create/edit using your favorite text editor a file in your /etc directory called agentid (/etc/agentid).
                2. Enter the keys shown without line spaces, one on each line
                3. Save the file as /etc/agentid
                (It should look like this)
                xxxxx
                xxxxxxxxxxxxxxxxx
                4. Create a directory called /otm
                5. Copy the starter.sh script (the one you downloaded) into this directory.
                (If you decide to use another directory, be sure to update the script by changing the 'start' value and put your starter script there instead)
                6. Make the script executable 'chmod 755 starter.sh'
                7. If you want to run it manually, just execute '/otm//starter.sh'
                8. If you want to run it as a service please check this post Monitor Your Internet With Linux Desktop Or Server.
                9. Once these steps have been followed, the Linux agent will be downloaded and automatically started.
                

                I'm stumped to be honest. I need to ask someone else here because unless I'm missing something in what you've shared, this should just work.

                I'll pass this on but it's late so someone will likely respond tomorrow. Hang in there, we'll get you up and running :).

                Regards,
                OutagesIO Support

                Search engines favor deep pockets making it difficult to find services like OutagesIO.
                To help us, you could leave a Google review, or share your reports in forums, or social media.
                You could mention us in articles, and perhaps someone would review us.
                We count on satisfied members spreading the word!

                C 1 Reply Last reply
                0
                • OutagesIO_SupportO OutagesIO_Support

                  Interesting since you're running 1.0.5 which is the latest and I just tested it with success.

                  First, do not delete the otminfo.log manually as the script needs it to complete it's steps, which is to confirm that the program was downloaded.

                  Just for reference and maybe you can see something different, this is what the steps are on the installation page itself.

                  STEPS
                  Now that you have downloaded the script and have the keys, please follow these steps:
                  
                  1. Create/edit using your favorite text editor a file in your /etc directory called agentid (/etc/agentid).
                  2. Enter the keys shown without line spaces, one on each line
                  3. Save the file as /etc/agentid
                  (It should look like this)
                  xxxxx
                  xxxxxxxxxxxxxxxxx
                  4. Create a directory called /otm
                  5. Copy the starter.sh script (the one you downloaded) into this directory.
                  (If you decide to use another directory, be sure to update the script by changing the 'start' value and put your starter script there instead)
                  6. Make the script executable 'chmod 755 starter.sh'
                  7. If you want to run it manually, just execute '/otm//starter.sh'
                  8. If you want to run it as a service please check this post Monitor Your Internet With Linux Desktop Or Server.
                  9. Once these steps have been followed, the Linux agent will be downloaded and automatically started.
                  

                  I'm stumped to be honest. I need to ask someone else here because unless I'm missing something in what you've shared, this should just work.

                  I'll pass this on but it's late so someone will likely respond tomorrow. Hang in there, we'll get you up and running :).

                  C Offline
                  C Offline
                  cwa
                  wrote on last edited by
                  #8

                  @OutagesIO_Support

                  I can confirm I followed those instructions exactly. If I made a mistake, it is be cause the brain is getting older sometimes makes foolish errors.
                  I've been coding in bash for over 20 years, professionally, and that script looks very clean. I'm baffled.
                  I'll stand by, no huge hurry on my end. In the meantime, thanks for the quick response, that was/is very impressive.

                  cwa

                  SBKS 1 Reply Last reply
                  0
                  • C cwa

                    @OutagesIO_Support

                    I can confirm I followed those instructions exactly. If I made a mistake, it is be cause the brain is getting older sometimes makes foolish errors.
                    I've been coding in bash for over 20 years, professionally, and that script looks very clean. I'm baffled.
                    I'll stand by, no huge hurry on my end. In the meantime, thanks for the quick response, that was/is very impressive.

                    cwa

                    SBKS Offline
                    SBKS Offline
                    SBK
                    wrote on last edited by
                    #9

                    @cwa

                    I feel the issue is in the permissions of the /otm directory


                    Try first this:

                    • Make /otm and its content 777
                    • Run the script again


                    If nothing changes then:

                    • Add the following line between lines 39 and 40:
                    echo "BINARY_LOCATION"
                    
                    • to be sure the final result is this
                        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 "BINARY_LOCATION"
                        echo "Getting the OTM Package"
                    
                    
                    • share the URL that is returned by the echo statement


                    Last but not least please share the content of the otminfo.log

                    Ed (K.)
                    Development Team

                    C 1 Reply Last reply
                    0
                    • SBKS SBK

                      @cwa

                      I feel the issue is in the permissions of the /otm directory


                      Try first this:

                      • Make /otm and its content 777
                      • Run the script again


                      If nothing changes then:

                      • Add the following line between lines 39 and 40:
                      echo "BINARY_LOCATION"
                      
                      • to be sure the final result is this
                          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 "BINARY_LOCATION"
                          echo "Getting the OTM Package"
                      
                      
                      • share the URL that is returned by the echo statement


                      Last but not least please share the content of the otminfo.log

                      C Offline
                      C Offline
                      cwa
                      wrote on last edited by
                      #10

                      @SBK ,

                      I thought of the same strategy last night, and I assure you that /otm has 777 octal permissions; I checked a few times just for my own sanity, and here is a screen shot:
                      octal permissions 2022-04-03 11-53-14.png
                      As for capturing the output of the curl command, I did exactly as you suggested, and their is no output, and no error either. I thought perhaps some quoting my help so on lines 38 and 39 I inserted the set -e and set -x commands. set -x prints out all of the commands executed in the script along with values assigned to variables. set -e stops execution at the 1st error thrown. We can see exactly what is going on line-by-line as the script executes. Here is a copy of that part of the script with my edit:

                      until [[ ${OTM_HTTP_STATUS} -eq 200 && ! -z ${OTM_REMOTE_LENGTH} ]]
                      do
                          sleep 5
                          ##
                          echo "Receiving binary location"
                      set -e 
                      set -x 
                          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 $STARTING_FOLDER/otminfo.log
                          OTM_HTTP_STATUS=$(cat $STARTING_FOLDER/otminfo.log | awk '/HTTP/ {print $2}')
                          OTM_REMOTE_LENGTH=$( cat $STARTING_FOLDER/otminfo.log | awk '/content-length/ {print $2}' | sed -e 's/[\r\n]//g' )
                      done
                      

                      And here is screen shot of the execution:
                      execution2 2022-04-03 12-15-36.png

                      And as you can see, I copied the curl command an ran it a few times directly on a command line... it just runs silently. The second curl command throws an error since the variable $BINARY_LOCATION is empty, and the script stops on that error.

                      It turns out it is a network issue and I don't no how to deal with it. I hope you guys do. I did this:
                      tracerroute 2022-04-03 12-21-34.png

                      Packet transmission is always stopped by the same host eth.14.2.cr2.phx0.phoenixnap.com. Since no packets ever reach www.foxymon.com, the 1st curl command has no output since $BINARY_LOCATION is empty.

                      Any ideas?

                      cwa

                      SBKS 1 Reply Last reply
                      0
                      • C cwa

                        @SBK ,

                        I thought of the same strategy last night, and I assure you that /otm has 777 octal permissions; I checked a few times just for my own sanity, and here is a screen shot:
                        octal permissions 2022-04-03 11-53-14.png
                        As for capturing the output of the curl command, I did exactly as you suggested, and their is no output, and no error either. I thought perhaps some quoting my help so on lines 38 and 39 I inserted the set -e and set -x commands. set -x prints out all of the commands executed in the script along with values assigned to variables. set -e stops execution at the 1st error thrown. We can see exactly what is going on line-by-line as the script executes. Here is a copy of that part of the script with my edit:

                        until [[ ${OTM_HTTP_STATUS} -eq 200 && ! -z ${OTM_REMOTE_LENGTH} ]]
                        do
                            sleep 5
                            ##
                            echo "Receiving binary location"
                        set -e 
                        set -x 
                            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 $STARTING_FOLDER/otminfo.log
                            OTM_HTTP_STATUS=$(cat $STARTING_FOLDER/otminfo.log | awk '/HTTP/ {print $2}')
                            OTM_REMOTE_LENGTH=$( cat $STARTING_FOLDER/otminfo.log | awk '/content-length/ {print $2}' | sed -e 's/[\r\n]//g' )
                        done
                        

                        And here is screen shot of the execution:
                        execution2 2022-04-03 12-15-36.png

                        And as you can see, I copied the curl command an ran it a few times directly on a command line... it just runs silently. The second curl command throws an error since the variable $BINARY_LOCATION is empty, and the script stops on that error.

                        It turns out it is a network issue and I don't no how to deal with it. I hope you guys do. I did this:
                        tracerroute 2022-04-03 12-21-34.png

                        Packet transmission is always stopped by the same host eth.14.2.cr2.phx0.phoenixnap.com. Since no packets ever reach www.foxymon.com, the 1st curl command has no output since $BINARY_LOCATION is empty.

                        Any ideas?

                        cwa

                        SBKS Offline
                        SBKS Offline
                        SBK
                        wrote on last edited by
                        #11

                        @cwa
                        Just to confirm, you still are experiencing the same issue?

                        Ed (K.)
                        Development Team

                        C 1 Reply Last reply
                        0
                        • OutagesIO_SupportO Offline
                          OutagesIO_SupportO Offline
                          OutagesIO_Support
                          wrote on last edited by
                          #12

                          BTW, pings will fail once they get into the data center. We block ICMP at the firewall due to heavy scanning of our network.

                          Regards,
                          OutagesIO Support

                          Search engines favor deep pockets making it difficult to find services like OutagesIO.
                          To help us, you could leave a Google review, or share your reports in forums, or social media.
                          You could mention us in articles, and perhaps someone would review us.
                          We count on satisfied members spreading the word!

                          C 1 Reply Last reply
                          0
                          • SBKS SBK

                            @cwa
                            Just to confirm, you still are experiencing the same issue?

                            C Offline
                            C Offline
                            cwa
                            wrote on last edited by
                            #13

                            @SBK ,
                            Yes, no change. I was hoping you guys would have found out what is going on. I'm a database admin, so I'm not very strong when it comes to troubleshooting network issues of this kind. If there are any other tests I can do let me know.

                            ~ cwa

                            SBKS 1 Reply Last reply
                            0
                            • OutagesIO_SupportO OutagesIO_Support

                              BTW, pings will fail once they get into the data center. We block ICMP at the firewall due to heavy scanning of our network.

                              C Offline
                              C Offline
                              cwa
                              wrote on last edited by
                              #14

                              @OutagesIO_Support ,
                              I am willing to run any kinds of tests you guys suggest. I'd really like to use your service. I spent a ton of time searching for a service like this and yours seemed to be the best for my needs.

                              ~ cwa

                              1 Reply Last reply
                              1
                              • OutagesIO_SupportO Offline
                                OutagesIO_SupportO Offline
                                OutagesIO_Support
                                wrote on last edited by OutagesIO_Support
                                #15

                                We're not going anywhere so it's important for us to fix anything that prevents anyone from using the service.

                                About the only problems we have left to find a solution to is a loss of access between the application and the database.

                                We're completely aware of that one and have been working on it for days trying to find the root cause. So far, nothing obvious, just lots of empty leads.

                                There are no other reasons that the site would be unreachable unless something on the Internet itself is causing our site to be broken somehow.

                                I don't know of any DNS hijack or anything along those lines since we didn't change DNS for the service, only for the DDNS function.

                                Maybe it's something that will just go away and start working suddenly. Really not sure what to say since we see everything up and running and have a ton of outside monitoring so we know about problems.

                                This is not an excuse since we know it's affecting more than one person but simply don't know what could be causing it.

                                How could you help? I don't know. I have to review the entire thread again and see if we can come up with some ideas.

                                Do you have another PC/Server you could try from, at another location perhaps?

                                Regards,
                                OutagesIO Support

                                Search engines favor deep pockets making it difficult to find services like OutagesIO.
                                To help us, you could leave a Google review, or share your reports in forums, or social media.
                                You could mention us in articles, and perhaps someone would review us.
                                We count on satisfied members spreading the word!

                                1 Reply Last reply
                                0
                                • C cwa

                                  @SBK ,
                                  Yes, no change. I was hoping you guys would have found out what is going on. I'm a database admin, so I'm not very strong when it comes to troubleshooting network issues of this kind. If there are any other tests I can do let me know.

                                  ~ cwa

                                  SBKS Offline
                                  SBKS Offline
                                  SBK
                                  wrote on last edited by
                                  #16

                                  @cwa
                                  Please try to execute this command on any console you have:

                                  curl -m 20 -s -u ZBjlLzGSC5:MB9rPpfVAUjwZO12RmqsI7bLJcWTiQGED5HleaF3 --connect-timeout 10 -X POST https://www.foxymon.com/receiver/receiver2.php -F function=receive_binary_location
                                  

                                  and let me know if you get an answer with a URL or still nothing as an answer

                                  Ed (K.)
                                  Development Team

                                  C 1 Reply Last reply
                                  0
                                  • OutagesIO_SupportO Offline
                                    OutagesIO_SupportO Offline
                                    OutagesIO_Support
                                    wrote on last edited by
                                    #17

                                    I just tested and the above works for me. The download link is shown.

                                    Regards,
                                    OutagesIO Support

                                    Search engines favor deep pockets making it difficult to find services like OutagesIO.
                                    To help us, you could leave a Google review, or share your reports in forums, or social media.
                                    You could mention us in articles, and perhaps someone would review us.
                                    We count on satisfied members spreading the word!

                                    1 Reply Last reply
                                    0
                                    • SBKS SBK

                                      @cwa
                                      Please try to execute this command on any console you have:

                                      curl -m 20 -s -u ZBjlLzGSC5:MB9rPpfVAUjwZO12RmqsI7bLJcWTiQGED5HleaF3 --connect-timeout 10 -X POST https://www.foxymon.com/receiver/receiver2.php -F function=receive_binary_location
                                      

                                      and let me know if you get an answer with a URL or still nothing as an answer

                                      C Offline
                                      C Offline
                                      cwa
                                      wrote on last edited by
                                      #18

                                      @SBK
                                      It runs successfully:

                                      curl -m 20 -s -u ZBjlLzGSC5:MB9rPpfVAUjwZO12RmqsI7bLJcWTiQGED5HleaF3 --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_linux
                                      

                                      I created a new agent and it worked with no issues, so I'm good to go now.

                                      ~cwa

                                      1 Reply Last reply
                                      0
                                      • OutagesIO_SupportO OutagesIO_Support referenced this topic on
                                      • OutagesIO_SupportO OutagesIO_Support marked this topic as a question on
                                      • OutagesIO_SupportO OutagesIO_Support has marked this topic as solved on
                                      Reply
                                      • Reply as topic
                                      Log in to reply
                                      • Oldest to Newest
                                      • Newest to Oldest
                                      • Most Votes


                                      • Login

                                      • Don't have an account? Register

                                      • Login or register to search.
                                      • First post
                                        Last post
                                      0
                                      • Categories
                                      • Recent
                                      • Tags
                                      • Popular
                                      • Users
                                      • Groups