Category5.TV Community Forum
update for login script /usr/local/bin/nems-info - Printable Version

+- Category5.TV Community Forum (https://forum.category5.tv)
+-- Forum: NEMS - Nagios Enterprise Monitoring Server (https://forum.category5.tv/forum-8.html)
+--- Forum: Bug Reports (https://forum.category5.tv/forum-38.html)
+--- Thread: update for login script /usr/local/bin/nems-info (/thread-322.html)



update for login script /usr/local/bin/nems-info - borgelite - 09-07-2018

Please update the login script im german and i use UTF8.
I become an error by login:

Code:
Linux nems 4.14.68-v7+ #1140 SMP Wed Sep 5 17:17:58 BST 2018 armv7l

Last login: Fri Sep  7 09:02:04 2018 from 10.0.1.86
0,00
/usr/local/bin/nems-info: Zeile 109: printf: 0.10836298932384: Ungültige Zahl.
   while executing
"exec -- /usr/local/bin/nems-info loadaverageround"
   invoked from within
"set sysload(10080) [exec -- /usr/local/bin/nems-info loadaverageround]"
   (file "/etc/motd.tcl" line 68)
[email protected]:~ $ sudo su



I change the login first line:
Code:
#!/bin/bash
# NEMS Server Info Script (primarily used for MOTD)
export LC_NUMERIC=C
export COMMAND=$1
export VARIABLE=$2

and the last line:


Code:
# Output usage info as no valid command line argument was provided
else
 echo "Usage: ./$me command"
 echo "For help, visit docs.nemslinux.com/commands/nems-info"
fi

unset LC_NUMERIC


now it works .


RE: update for login script /usr/local/bin/nems-info - Robbie Ferguson - 09-07-2018

Thanks for letting me know.

Do you know how to do a Pull Request? Looks like you've already written a patch, so that'd be nice if you submitted it as a PR.

Also, please note that because you edited that script, you have broken your nems-update.

You'll need to reinstall nems-scripts, or reflash your card, because now you will be unable to receive updates from the server (as your git commit is out of sync since you manually edited init.sh).

Let me know. I can help you fix it, and also apply a patch if you're not sure how to do a Pull Request.


RE: update for login script /usr/local/bin/nems-info - Robbie Ferguson - 09-07-2018

Hi again, borgelite.
Don't worry about the PR at this point - I've pushed out the fix.
The issue now though is that you have edited your NEMS source, so you are now out of sync.

Please run the following command as root (sudo su):

cd /usr/local/share/nems && rm -rf nems-scripts && git clone https://github.com/Cat5TV/nems-scripts

That will delete your edited copy and reinstall nems-scripts (which contains nems-info).

You'll see the current copy contains your patch, so it should work now. Please let me know if you have any other trouble, and thanks again for pointing this out!