1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

RT-AC68U NVRAM Low Warning

Discussion in 'Asuswrt-Merlin' started by LexLuthor, Feb 25, 2020.

  1. LexLuthor

    LexLuthor Occasional Visitor

    Joined:
    Dec 3, 2015
    Messages:
    44
    Hi,

    I have an Asus RT-AC68U and I'm getting an NVRAM low warning.

    I found this thread and it looks like there are a couple of helpful things here.
    https://www.snbforums.com/threads/solved-high-nvram-usage.56848/

    I just don't know where to start as far as running the script on the router. I've activated support for scripts in admin->system. I understand that I have to create a file using the code in that thread and I guess I have to save it a certain way (using notepad++?) and then upload it to /jffs/scripts on the router and then run it. But how do I get it loaded into /jffs/scripts and how do I run it? Can I then delete the script after it's done running?
     
  2. LexLuthor

    LexLuthor Occasional Visitor

    Joined:
    Dec 3, 2015
    Messages:
    44
    Ok, so I figured out I have to connect to the router using WinSCP. I can navigate to /jffs/scripts. But how do I save the script, where do I put it and how do I run it?
     
  3. appleseed

    appleseed Regular Contributor

    Joined:
    Jun 26, 2010
    Messages:
    101
    Location:
    everywhere
    https://github.com/RMerl/asuswrt-merlin.ng/wiki/User-scripts#creating-scripts
     
  4. JohnD5000

    JohnD5000 Regular Contributor

    Joined:
    Nov 20, 2016
    Messages:
    160
    I'm a noob, but this should get you started

    In GUI
    Administation/System
    Enable SSH - Lan Only (this might already be set if logged in with WinSCP)

    In WinSCP
    1)Open folder with script file in left box, right box /jffs/scripts
    2) Right click on script and select Upload
    3) Go to right box, right click on script, select properties, and make sure all boxes with an X have a check mark in them (this makes script executable)
    -----------

    Install PUTTY on your computer, log in (since you figured this out with WinSCP I assume you can figure it out with Putty, too)
    In Putty
    cd /jffs/scripts
    dos2unix -u scriptname (might not be necessary but just in case notepad ++ didn't save to a unix format)
    sh scriptname (note, script name is case sensitive) this will run script
     
    LexLuthor likes this.
  5. LexLuthor

    LexLuthor Occasional Visitor

    Joined:
    Dec 3, 2015
    Messages:
    44
    Thank you for the replies. I would have thought this would be documented somewhere.

    I should be able to figure out putty. I'll look at that now. EDIT: I'm good with putty.

    Ok, so I copied the script text from the other thread to notepad++. What name do I save it as? I see it has to have a unix ending, but what does that mean?
     
  6. JohnD5000

    JohnD5000 Regular Contributor

    Joined:
    Nov 20, 2016
    Messages:
    160
    it can be almost any name. Doesn't need an ending, but *.sh seems to be good naming convention. Ie. LowWarn.sh
     
  7. LexLuthor

    LexLuthor Occasional Visitor

    Joined:
    Dec 3, 2015
    Messages:
    44
    Ok, I used this post for the script https://www.snbforums.com/threads/solved-high-nvram-usage.56848/#post-494586
    I just saved it as lowwarn1.sh, uploaded it and set the permissions. I then ran the putty commands and it looks like the script ran as I received the 2 echo command texts.
    I rebooted the router and free nvram is unchanged. I had definitely been playing with some openvpn connections over time so I was hopeful that script might work here.

    Did the script not run correctly or what other script should I try?
     
    Last edited: Feb 26, 2020
  8. JohnD5000

    JohnD5000 Regular Contributor

    Joined:
    Nov 20, 2016
    Messages:
    160

    Sorry, I'm a noob at scripting, I've just been in your shoes that there was no simple instructions on how to run a script, which is what I gave you.

    Just a note that these routers run with 95% or so memory. In Merlin click on Tools/Sysinfo and look at free memory, cache memory swap memory ,etc. My main screen shows memory usage at 95%, but 31.34 MB free, 14.47 MB Buffers, 88.54 MB cache and a swap 1.29 / 2048 MB (not sure what these numbers mean but I think I'm OK. Also, NVRAM usage 67128/ 131072 bytes and JFFS 7.43 / 48 MB. Again, don't know what numbers mean but I think I'm OK.
     
  9. LexLuthor

    LexLuthor Occasional Visitor

    Joined:
    Dec 3, 2015
    Messages:
    44
    It certainly looks like that first script ran, but didn't do anything as far as freeing up nvram. At least I think I have the script creating and running part down.

    Should I, and if so, how do I run the "one liner" from this post?
    https://www.snbforums.com/threads/solved-high-nvram-usage.56848/#post-494600

    Anything else I can do or other scripts to run to try to free up nvram? Or did my script not really run?

    NVRAM Usage: 63389 / 65536 bytes
     
  10. JohnD5000

    JohnD5000 Regular Contributor

    Joined:
    Nov 20, 2016
    Messages:
    160
    to run the command, just type it into putty as a command. Note: make sure you know what it is doing.

    To test a script in "debug mode" (not sure if that is correct term here) enter sh -x scriptname which gives a more verbose response when run
     
  11. LexLuthor

    LexLuthor Occasional Visitor

    Joined:
    Dec 3, 2015
    Messages:
    44
    I appreciate the assistance so far!
    So I re-ran the script with the -x and I got a bunch of + nvram unset lines spit back at me. I guess that means it really ran?

    As for running that line directly in putty, I thought that might be possible, but what do I type in? Everything starting with for line in through nvram commit? Just in one long line?

    EDIT: I figured out how to paste into putty using right click mouse and ran that whole command line
    for line in `nvram show | grep =$ `; do var=${line%*=}; nvram unset $var; done; nvram commit

    I no longer have the nvram warning! NVRAM usage: 54081 / 65536 bytes

    JohnD5000, I can't thank you enough.

    Hopefully, this thread helps someone else someday.
     
    Last edited: Feb 26, 2020
  12. JohnD5000

    JohnD5000 Regular Contributor

    Joined:
    Nov 20, 2016
    Messages:
    160
    Can't help you with the line (over my head) but just type it in exactly and hit enter. I assume it is posted correctly.

    To copy in Putty, copy the line normally, then go to putty and right click mouse
     
  13. LexLuthor

    LexLuthor Occasional Visitor

    Joined:
    Dec 3, 2015
    Messages:
    44
    Sorry, I edited my previous post. Read it again.

    Thank you!

    EDIT: After reboot, it's back up a bit, so maybe we don't yet have this solved
    61513 / 65536 bytes.
    The warning is still off at least.
     
  14. JohnD5000

    JohnD5000 Regular Contributor

    Joined:
    Nov 20, 2016
    Messages:
    160
    Glad it worked! I'm usually getting help, not giving :)
     
    L&LD likes this.