What's new

connmon connmon - Internet connection monitoring

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

I have a feature request/suggestion although I'm not sure it entirely sure whether it should be, should you even consider it, an expansion to connmon or a whole different addon ('vpnmon?') but one of my OpenVPN-clients looses connection on irregular intervals and it would be very useful if I could sent my VPN provider a connmon-like summary of when the tunnel goes down, as it's almost daily now, mostly during the night, at various times.

WAN stays connected (devices with policy based routing bypassing the tunnel keep their connection, so it's not my ISP), I can't find no apparent reason in syslog other than it's remotely disconnected and also the time frame before for it to get restored varies greatly. Also there's no announced maintenance, so I can only conclude it's a disruption of their service. As there's a kill switch in place it cause several devices loose their internet connection (including my home security system) which is not desirable.

Somehow it manages to stay between the intervals that spdMerlin is running (which was hourly, but now brought back to twice an hour), so I can't seem to 'catch' it using spdMerlin.

Would you please consider? Thanks in advance.
 
I have a feature request/suggestion although I'm not sure it entirely sure whether it should be, should you even consider it, an expansion to connmon or a whole different addon ('vpnmon?') but one of my OpenVPN-clients looses connection on irregular intervals and it would be very useful if I could sent my VPN provider a connmon-like summary of when the tunnel goes down, as it's almost daily now, mostly during the night, at various times.

WAN stays connected (devices with policy based routing bypassing the tunnel keep their connection, so it's not my ISP), I can't find no apparent reason in syslog other than it's remotely disconnected and also the time frame before for it to get restored varies greatly. Also there's no announced maintenance, so I can only conclude it's a disruption of their service. As there's a kill switch in place it cause several devices loose their internet connection (including my home security system) which is not desirable.

Somehow it manages to stay between the intervals that spdMerlin is running (which was hourly, but now brought back to twice an hour), so I can't seem to 'catch' it using spdMerlin.

Would you please consider? Thanks in advance.
I get some insight from @Martineau in this thread to have simething similar done.

 
Hi folks,

Regarding this point in a recent changelog:


  • NEW: Setting to choose whether to include ping tests in QoS or not

Can someone advise around this option? What are the pro's con's of it being enabled or not. Just trying to decide which way I should go for my particular set of use cases.
I do use FlexQoS / Adaptive QoS.
Thank you.
 
Hi folks,

Regarding this point in a recent changelog:


  • NEW: Setting to choose whether to include ping tests in QoS or not

Can someone advise around this option? What are the pro's con's of it being enabled or not. Just trying to decide which way I should go for my particular set of use cases.
I do use FlexQoS / Adaptive QoS.
Thank you.

I am really curious about this, too. However, I use cake-qos. If I understand correctly, and I might be wrong, connmon stops cake-qos when doing the ping tests if this option is enabled.
Link to the commit with this change: github

I wonder how stopping cake-qos every x minutes for y seconds would affect video conferencing?

Thank you Jack for the work you've put in this project.
 
Hello,

I like having the option for spdMerlin.
For connmon, I don't bother, I let the pings under the umbrella of the QoS (Exclude=NO). I'm convinced the impact on connmon is close to zero. And the potential undesirable side effect of stopping QoS (e.g. on videoconferencing) is too high a price to pay in my eyes.


NB: If you read that code,
"/jffs/addons/cake-qos/cake-qos stop" relates to Merlin before 386.2, when Cake was an add-on (not built-in).
Cake in 386.2 is built-in and managed like other QoS flavours.
 
Hello,

I like having the option for spdMerlin.
For connmon, I don't bother, I let the pings under the umbrella of the QoS (Exclude=NO). I'm convinced the impact on connmon is close to zero. And the potential undesirable side effect of stopping QoS (e.g. on videoconferencing) is too high a price to pay in my eyes.


NB: If you read that code,
"/jffs/addons/cake-qos/cake-qos stop" relates to Merlin before 386.2, when Cake was an add-on (not built-in).
Cake in 386.2 is built-in and managed like other QoS flavours.

Not sure whether your responding to my comment regarding connmon, but the reason I decided to temporary disable it (Exclude = Yes), is because every time it runs, your will be reset. As I wanted to gather some more data, I temporarily disabled it. I don't think it has any effect, as you mentioned, but if I want to collect a reasonable amount of data I can't have QoS stopped and restarted (and emptying the stats) every x minutes, because then I have no data to compare.
 
Dear Jack,

Thank you again for connmon. It is brilliant as is. And it is brilliantly developed, in a way that allowed me to fork it and tune it to my needs in no time (additionnal-targets branch in github). I have used open source/free software a lot. But it's the first time, I can really benefit from the availability of the code. I wouldn't know where to start if I wanted to adapt LibreOffice, Firefox or Ubuntu... Thank you.

I have been playing with connmon and spdMerlin quite a lot recently and I wanted to share some feedback.

1. Period to display, Time axis
connmon shows 3 graphs. Each graph has a control to choose "Period to display". They are completely separate.

1A. I would prefer if all graphs showed the same period. The global period might be selected with just one common control. Or it could be selected with 3 synchronised controls (changing one control would change the other controls). Actually, I think this behaviour would also be desirable for spdMerlin. At the moment, I always end up having to change the period repeatedly, in multiple controls.
1B. When zooming with the mouse, it would be super cool if the refined _period_ was applied to all 3 graphs (e.g. zoom on 2 days and all 3 graphs show those 2 days). (Of course, the vertical axis zoom should only apply to 1 graph, as it does now.)
1C. By the way, "scale type" should certainly stays "as is", with potentially different values for different graphs.
1D. I'm not sure about the "Data interval". I don't really care as I never change it anyway. ;-)

2. Quality figure etc
I have abused the script to extend the duration to e.g. 300 seconds, hardcoded. By the way, is there a specific reason why you limit the duration to 60 seconds ?
Full disclosure, the "Packet Loss" figure from spdMerlin is probably more interesting/reliable than the "Line quality" from connmon. But connmon is so lightweight/cheap that one can run it more frequently and gather more detailed information for rare events.
2A. At the moment, you read the output from ping (e.g. 112 packets transmitted, 110 packets received, 1% packet loss ). However, that ping implementation doesn't seem to do rounding correctly. In the previous example, you would expect 2%, not 1%. Maybe you could apply your tail|head|cut|awk magic to do proper math, and even come up with a decimal number. (NB: Of course, if the maximum stays 60 seconds, the decimal topic is moot.)
2B. The quality figure (which doesn't have a decimal part at the moment) appears in the table with one decimal (always 0). You obviously manage different formatting for different columns. So maybe you could avoid displaying the decimal part (at least until there is a real decimal value to display, if ever).
2C. In the graph, the tiptext displays the quality with 2 decimal digits (always 00). All figures appear with 2 decimal in the tiptext. So, I guess it's probably managed commonly and not worth a change.

I would perfectly understand if you have better stuff to do. connmon already works great as it is now. And, as a fun fact, I would possibly not even benefit from the changes, if any, as I created a fork and I'm not really up to speed yet with git, branches etc...

And for other visitors of the forum, please feel free to voice your opinion if you feel my suggestions would actually go against your own preferences.


Thank you again

Best regards
W.

PS: Maybe I should get interested in javascript actually. But I already have quite a lot to learn with dash scripts... ;-)
 
Last edited:
Dear Jack,

Thank you again for connmon. It is brilliant as is. And it is brilliantly developed, in a way that allowed me to fork it and tune it to my needs in no time (additionnal-targets branch in github). I have used open source/free software a lot. But it's the first time, I can really benefit from the availability of the code. I wouldn't know where to start if I wanted to adapt LibreOffice, Firefox or Ubuntu... Thank you.

I have been playing with connmon and spdMerlin quite a lot recently and I wanted to share some feedback.

1. Period to display, Time axis
connmon shows 3 graphs. Each graph has a control to choose "Period to display". They are completely separate.

1A. I would prefer if all graphs showed the same period. The global period might be selected with just one common control. Or it could be selected with 3 synchronised controls (changing one control would change the other controls). Actually, I think this behaviour would also be desirable for spdMerlin. At the moment, I always end up having to change the period repeatedly, in multiple controls.
1B. When zooming with the mouse, it would be super cool if the refined _period_ was applied to all 3 graphs (e.g. zoom on 2 days and all 3 graphs show those 2 days). (Of course, the vertical axis zoom should only apply to 1 graph, as it does now.)
1C. By the way, "scale type" should certainly stays "as is", with potentially different values for different graphs.
1D. I'm not sure about the "Data interval". I don't really care as I never change it anyway. ;-)

2. Quality figure etc
I have abused the script to extend the duration to e.g. 300 seconds, hardcoded. By the way, is there a specific reason why you limit the duration to 60 seconds ?
Full disclosure, the "Packet Loss" figure from spdMerlin is probably more interesting/reliable than the "Line quality" from connmon. But connmon is so lightweight/cheap that one can run it more frequently and gather more detailed information for rare events.
2A. At the moment, you read the output from ping (e.g. 112 packets transmitted, 110 packets received, 1% packet loss ). However, that ping implementation doesn't seem to do rounding correctly. In the previous example, you would expect 2%, not 1%. Maybe you could apply your tail|head|cut|awk magic to do proper math, and even come up with a decimal number. (NB: Of course, if the maximum stays 60 seconds, the decimal topic is moot.)
2B. The quality figure (which doesn't have a decimal part at the moment) appears in the table with one decimal (always 0). You obviously manage different formatting for different columns. So maybe you could avoid displaying the decimal part (at least until there is a real decimal value to display, if ever).
2C. In the graph, the tiptext displays the quality with 2 decimal digits (always 00). All figures appear with 2 decimal in the tiptext. So, I guess it's probably managed commonly and not worth a change.

I would perfectly understand if you have better stuff to do. connmon already works great as it is now. And, as a fun fact, I would possibly not even benefit from the changes, if any, as I created a fork and I'm not really up to speed yet with git, branches etc...

And for other visitors of the forum, please feel free to voice your opinion if you feel my suggestions would actually go against your own preferences.


Thank you again

Best regards
W.

PS: Maybe I should get interested in javascript actually. But I already have quite a lot to learn with dash scripts... ;-)
good suggestions! some responses:

1A - i'll add this to the wishlist
1B - not easy as would require hooking into the chartjs zoom plugin and applying the same zoom level. unlikely that I'll work on this anytime soon

2 - 60s seemed like a sane maximum. packet loss gives you more control over the parameters on the ping test rather than whatever ookla do in speedtest
2a - this seems like a worthwhile improvement
2b - the decimals probably come from the database off the top of my head as they're stored as "real" values. decimals could be truncated for 100%, I'll wishlist it
 
Thank you for your interest. Take care. W.
 
v2.11.5 is now available
Changelog:

  • FIXED: WebUI charts using Day grouping wouldn't display data between midnight and 1am
  • FIXED: Database reset would incorrectly report disk space availability
Hi @Jack Yaz ,

Thanks for the v2.11.6 update.
 
@Jack Yaz - After an auto-reboot at 2:30am this morning, connmon is not showing the the Add-Ons tab. Any idea why a reboot would cause this? What can I do to get it to display? I tried a UF command but that did not work.
 
@Jack Yaz - After an auto-reboot at 2:30am this morning, connmon is not showing the the Add-Ons tab. Any idea why a reboot would cause this? What can I do to get it to display? I tried a UF command but that did not work.
does running
Code:
connmon startup force
bring it back?
 
Yes, that worked, thanks.
 
I can't seem to remove the database records via connmon.
Getting "Database size exceeds available space. 32.0KB is required to create backup." even if I have enough disk space.

Code:
admin@RT-AC86U-7CA8:/tmp/home/root# df -h
Filesystem                Size      Used Available Use% Mounted on
ubi:rootfs_ubifs         77.2M     64.6M     12.6M  84% /
devtmpfs                214.9M         0    214.9M   0% /dev
tmpfs                   215.0M    556.0K    214.5M   0% /var
tmpfs                   215.0M    972.0K    214.1M   0% /tmp/mnt
mtd:bootfs                4.4M      3.3M      1.1M  75% /bootfs
tmpfs                   215.0M    972.0K    214.1M   0% /tmp/mnt
mtd:data                  8.0M    584.0K      7.4M   7% /data
tmpfs                   215.0M    972.0K    214.1M   0% /tmp
/dev/mtdblock9           47.0M      2.4M     44.6M   5% /jffs
/dev/sda1                 9.5G      2.0G      6.9G  23% /tmp/mnt/sda1
/dev/sda2               921.8G     43.4G    878.4G   5% /tmp/mnt/external
tmpfs                   215.0M    972.0K    214.1M   0% /www/index_style.css
tmpfs                   215.0M    972.0K    214.1M   0% /www/require/modules/menuTree.js
admin@RT-AC86U-7CA8:/tmp/home/root# connmon

##############################################################
##     ___   ___   _ __   _ __   _ __ ___    ___   _ __     ##
##    / __| / _ \ | '_ \ | '_ \ | '_   _ \  / _ \ | '_ \    ##
##   | (__ | (_) || | | || | | || | | | | || (_) || | | |   ##
##    \___| \___/ |_| |_||_| |_||_| |_| |_| \___/ |_| |_|   ##
##                                                          ##
##                  v2.11.7 on RT-AC86U                     ##
##                                                          ##
##            https://github.com/jackyaz/connmon            ##
##                                                          ##
##############################################################

WebUI for connmon is available at:
http://192.168.50.1/user1.asp

1.    Check connection now

2.    Set preferred ping server
      Currently: 8.8.4.4

3.    Set ping test duration
      Currently: 60s

4.    Toggle automatic ping tests
      Currently: Disabled

5.    Set schedule for automatic ping tests
      Every 2 minutes
      Days of week: All

6.    Toggle time output mode
      Currently non-unix time values will be used for CSV exports

7.    Set number of ping test results to show in WebUI
      Currently: 10 results will be shown

8.    Set number of days data to keep in database
      Currently: 30 days data will be kept

s.    Toggle storage location for stats and config
      Current location is usb

q.    Toggle exclusion of connmon ping tests from QoS
      Currently connmon ping tests are excluded from QoS

u.    Check for updates
uf.   Update connmon with latest version (force update)

r.    Reset connmon database / delete all data

e.    Exit connmon

z.    Uninstall connmon

##############################################################

Choose an option:  r

WARNING: This will reset the connmon database by deleting all database records.
A backup of the database will be created if you change your mind.

Do you want to continue? (y/n)  y

Database size exceeds available space. 32.0KB is required to create backup.

Press enter to continue...

##############################################################
##     ___   ___   _ __   _ __   _ __ ___    ___   _ __     ##
##    / __| / _ \ | '_ \ | '_ \ | '_   _ \  / _ \ | '_ \    ##
##   | (__ | (_) || | | || | | || | | | | || (_) || | | |   ##
##    \___| \___/ |_| |_||_| |_||_| |_| |_| \___/ |_| |_|   ##
##                                                          ##
##                  v2.11.7 on RT-AC86U                     ##
##                                                          ##
##            https://github.com/jackyaz/connmon            ##
##                                                          ##
##############################################################

WebUI for connmon is available at:
http://192.168.50.1/user1.asp

1.    Check connection now

2.    Set preferred ping server
      Currently: 8.8.4.4

3.    Set ping test duration
      Currently: 60s

4.    Toggle automatic ping tests
      Currently: Disabled

5.    Set schedule for automatic ping tests
      Every 2 minutes
      Days of week: All

6.    Toggle time output mode
      Currently non-unix time values will be used for CSV exports

7.    Set number of ping test results to show in WebUI
      Currently: 10 results will be shown

8.    Set number of days data to keep in database
      Currently: 30 days data will be kept

s.    Toggle storage location for stats and config
      Current location is usb

q.    Toggle exclusion of connmon ping tests from QoS
      Currently connmon ping tests are excluded from QoS

u.    Check for updates
uf.   Update connmon with latest version (force update)

r.    Reset connmon database / delete all data

e.    Exit connmon

z.    Uninstall connmon

##############################################################

Choose an option:
 
I can't seem to remove the database records via connmon.
Getting "Database size exceeds available space. 32.0KB is required to create backup." even if I have enough disk space.

Code:
admin@RT-AC86U-7CA8:/tmp/home/root# df -h
Filesystem                Size      Used Available Use% Mounted on
ubi:rootfs_ubifs         77.2M     64.6M     12.6M  84% /
devtmpfs                214.9M         0    214.9M   0% /dev
tmpfs                   215.0M    556.0K    214.5M   0% /var
tmpfs                   215.0M    972.0K    214.1M   0% /tmp/mnt
mtd:bootfs                4.4M      3.3M      1.1M  75% /bootfs
tmpfs                   215.0M    972.0K    214.1M   0% /tmp/mnt
mtd:data                  8.0M    584.0K      7.4M   7% /data
tmpfs                   215.0M    972.0K    214.1M   0% /tmp
/dev/mtdblock9           47.0M      2.4M     44.6M   5% /jffs
/dev/sda1                 9.5G      2.0G      6.9G  23% /tmp/mnt/sda1
/dev/sda2               921.8G     43.4G    878.4G   5% /tmp/mnt/external
tmpfs                   215.0M    972.0K    214.1M   0% /www/index_style.css
tmpfs                   215.0M    972.0K    214.1M   0% /www/require/modules/menuTree.js
admin@RT-AC86U-7CA8:/tmp/home/root# connmon

##############################################################
##     ___   ___   _ __   _ __   _ __ ___    ___   _ __     ##
##    / __| / _ \ | '_ \ | '_ \ | '_   _ \  / _ \ | '_ \    ##
##   | (__ | (_) || | | || | | || | | | | || (_) || | | |   ##
##    \___| \___/ |_| |_||_| |_||_| |_| |_| \___/ |_| |_|   ##
##                                                          ##
##                  v2.11.7 on RT-AC86U                     ##
##                                                          ##
##            https://github.com/jackyaz/connmon            ##
##                                                          ##
##############################################################

WebUI for connmon is available at:
http://192.168.50.1/user1.asp

1.    Check connection now

2.    Set preferred ping server
      Currently: 8.8.4.4

3.    Set ping test duration
      Currently: 60s

4.    Toggle automatic ping tests
      Currently: Disabled

5.    Set schedule for automatic ping tests
      Every 2 minutes
      Days of week: All

6.    Toggle time output mode
      Currently non-unix time values will be used for CSV exports

7.    Set number of ping test results to show in WebUI
      Currently: 10 results will be shown

8.    Set number of days data to keep in database
      Currently: 30 days data will be kept

s.    Toggle storage location for stats and config
      Current location is usb

q.    Toggle exclusion of connmon ping tests from QoS
      Currently connmon ping tests are excluded from QoS

u.    Check for updates
uf.   Update connmon with latest version (force update)

r.    Reset connmon database / delete all data

e.    Exit connmon

z.    Uninstall connmon

##############################################################

Choose an option:  r

WARNING: This will reset the connmon database by deleting all database records.
A backup of the database will be created if you change your mind.

Do you want to continue? (y/n)  y

Database size exceeds available space. 32.0KB is required to create backup.

Press enter to continue...

##############################################################
##     ___   ___   _ __   _ __   _ __ ___    ___   _ __     ##
##    / __| / _ \ | '_ \ | '_ \ | '_   _ \  / _ \ | '_ \    ##
##   | (__ | (_) || | | || | | || | | | | || (_) || | | |   ##
##    \___| \___/ |_| |_||_| |_||_| |_| |_| \___/ |_| |_|   ##
##                                                          ##
##                  v2.11.7 on RT-AC86U                     ##
##                                                          ##
##            https://github.com/jackyaz/connmon            ##
##                                                          ##
##############################################################

WebUI for connmon is available at:
http://192.168.50.1/user1.asp

1.    Check connection now

2.    Set preferred ping server
      Currently: 8.8.4.4

3.    Set ping test duration
      Currently: 60s

4.    Toggle automatic ping tests
      Currently: Disabled

5.    Set schedule for automatic ping tests
      Every 2 minutes
      Days of week: All

6.    Toggle time output mode
      Currently non-unix time values will be used for CSV exports

7.    Set number of ping test results to show in WebUI
      Currently: 10 results will be shown

8.    Set number of days data to keep in database
      Currently: 30 days data will be kept

s.    Toggle storage location for stats and config
      Current location is usb

q.    Toggle exclusion of connmon ping tests from QoS
      Currently connmon ping tests are excluded from QoS

u.    Check for updates
uf.   Update connmon with latest version (force update)

r.    Reset connmon database / delete all data

e.    Exit connmon

z.    Uninstall connmon

##############################################################

Choose an option:
could be an arithmetic error in the code. please share output of
Code:
ls -l /opt/share/connmon.d/connstats.db
df -P -k /opt/share/connmon.d/
 
could be an arithmetic error in the code. please share output of
Code:
ls -l /opt/share/connmon.d/connstats.db
df -P -k /opt/share/connmon.d/

@Jack Yaz I checked on the code and propose the following modification to the code base.

FROM (LINE 1192):
Code:
if [ "$SIZEDB" -gt "$((SIZEAVAIL*1024))" ]; then

TO (LINE 1192):
Code:
if [ "$SIZEDB" -gt "$SIZEAVAIL" ]; then

I have tried to create a dummy script to simulate this scenario (See attachment)
Code:
admin@RT-AC86U-7CA8:/tmp/home/root# bash test.sh
SCRIPT_STORAGE_DIR: /opt/share/connmon.d
SIZEAVAIL: 7256944
SIZEDB: 212992

Original Code:
Database size exceeds available space. 208.0KB is required to create backup.

Modified Code:
Sufficient free space to back up database, proceeding...

Maybe this could help you resolve the issue and release a patch. :)

Note: It would be a good thing to add an option where a user will be asked if he wants to back up the previous database and also to check on the lock files before performing any deletion to the database files.

By the way. This is a great tool for monitoring your connection. Really appreciate this one. Cheers!
 

Attachments

  • test.txt
    892 bytes · Views: 137
Last edited:

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top