SOLVED Data for UPS is stale

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
I have the CP1500PFCLCD and i'm also having the stale message.

Are we not supposed to add "MAXAGE 25" to auxiliary parameters in the gui?
You can't set it in the gui. There is no option to add values to the upsd.conf file.
 

STREBLO

Patron
Joined
Oct 23, 2015
Messages
245
Oh, right now it just edits a different config
You can't set it in the gui. There is no option to add values to the upsd.conf file.
Ahh, the gui changes ups.conf. Mybad.
 

trey22

Dabbler
Joined
Apr 11, 2013
Messages
28
Newbie trying hard here to learn. Does the CLI entry edit the upsd.conf file directly, or do I need to use an external editor (if so, which one and how)?

I opened up a shell and typed:

service nut stop

echo "MAXAGE 25">>/etc/local/nut/upsd.conf

service nut start
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Newbie trying hard here to learn. Does the CLI entry edit the upsd.conf file directly, or do I need to use an external editor (if so, which one and how)?

I opened up a shell and typed:

service nut stop

echo "MAXAGE 25">>/etc/local/nut/upsd.conf

service nut start
>> symbol redirects stdout to the file you specified and appends it to that file. No need for an editor.
 

trey22

Dabbler
Joined
Apr 11, 2013
Messages
28
Great, TYVM! It's been almost 20 minutes and "no data for UPS is stale" messages. They were popping up every couple of minutes before.
 

STREBLO

Patron
Joined
Oct 23, 2015
Messages
245
If we add an init script in the gui to write "echo "MAXAGE 25">>/etc/local/nut/upsd.conf" it can write to the boot disk right?
 

STREBLO

Patron
Joined
Oct 23, 2015
Messages
245
After changing the max age should you stop getting messages from your ups in the terminal saying the data is no longer sale? I'm not getting emails but in the little terminal that shows what's going on currently I keep seeing messages data for UPS is still check driver and then it says data is no longer stale. Will I continue to get these? My MAXAGE is set to 25.
 

STREBLO

Patron
Joined
Oct 23, 2015
Messages
245
I'm not sure why but I seem to be getting tons of emails still, I have maxage set to 30 and I'm still getting messages. I'm using the 1500 so I'm not sure if that's why. Is anyone using it as well and has solved this problem?
 

STREBLO

Patron
Joined
Oct 23, 2015
Messages
245
I just wanted to let everyone know that if they're having the same problem I was having we're changing the value didn't change anything I found out why it wasn't working for me.

I don't know if this was obvious for you guys but I didn't restart the ups daemon after changing it. Make sure to use the command upsd -c reload after changing your value. I've set it to change my max value and reload the demon in an init script.

Code:
echo "MAXAGE 25">>/etc/local/nut/upsd.conf
upsd -c reload
 

dj_jazzn

Dabbler
Joined
Apr 14, 2014
Messages
31
I don't know if this was obvious for you guys but I didn't restart the ups daemon after changing it. Make sure to use the command upsd -c reload after changing your value. I've set it to change my max value and reload the demon in an init script.

I have been manually updating the uspd.conf file from the command line after every startup. Part of that method included stopping and restarting the service.

Code:
service nut stop
nano /etc/local/nut/upsd.conf (in editor add "MAXAGE 25" to last line of file and save)
service nut start


However, automating this with a script would be very nice (nicer still would be a proper fix for this issue).
Does this init script method work for you after reboots?
 

ethereal

Guru
Joined
Sep 10, 2012
Messages
762
i have a script

#!/bin/bash

echo "MAXAGE 30" >> /etc/local/nut/upsd.conf
service nut restart

exit 0

i run this as an init script and it works with reboots
 

STREBLO

Patron
Joined
Oct 23, 2015
Messages
245
I have been manually updating the uspd.conf file from the command line after every startup. Part of that method included stopping and restarting the service.

Code:
service nut stop
nano /etc/local/nut/upsd.conf (in editor add "MAXAGE 25" to last line of file and save)
service nut start


However, automating this with a script would be very nice (nicer still would be a proper fix for this issue).
Does this init script method work for you after reboots?
Sometimes, not very reliably.
 

enemy85

Guru
Joined
Jun 10, 2011
Messages
757
having the same problem here, again after long time it seemed to happen less frequently...
now trying with both the script and the "auto" value in the "port" field at ups service tab.
let's see what happens
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
having the same problem here, again after long time it seemed to happen less frequently...
now trying with both the script and the "auto" value in the "port" field at ups service tab.
let's see what happens
The auto value means nothing. The nut doc say that when using usbhid device the port value isn't even used. The maxage modification should fix it
 

enemy85

Guru
Joined
Jun 10, 2011
Messages
757
The auto value means nothing. The nut doc say that when using usbhid device the port value isn't even used. The maxage modification should fix it

my script seems not to work...
I added the script (as a .sh file uploaded on my nas) and i set the pre-init script job, but looking at the upsd.conf file, i can't find the "maxage 30" line it shoud add...

#!/bin/bash

echo "MAXAGE 30" >> /etc/local/nut/upsd.conf
service nut restart

exit 0


I even tried to chaange the first line, as per another script i used to have...
#!/bin/sh


what am i doing wrong?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
What did you put in the gui to call the script, is the script executable? Can you run it yourself.
 

enemy85

Guru
Joined
Jun 10, 2011
Messages
757
What did you put in the gui to call the script, is the script executable? Can you run it yourself.
what do you mean? Could you better explain your question?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
If you try to run the script from the command line does it work?

Can you give a screen shot of how you configured the gui with the pre- init script.
 

enemy85

Guru
Joined
Jun 10, 2011
Messages
757
probably found the problem...and your suggestion to make a test from command line make me find it...
the script filename had a space in it...now i eliminated it and it should works.
Thanks
 

enemy85

Guru
Joined
Jun 10, 2011
Messages
757
even with the script i got again the data stale problem.... :(
 
Top