NUT Dashboard Widget (2.1.4)
-
Works well, thanks! Just a couple minor comments,
- it would be good to have the title "UPS Status" to link to the appropriate page (like other widgets do)
- my UPS shows up fine, all works … but Status shows as "ERROR"?
Thanks again!
- about link - it is already done in my repository, patch links slightly outdated
- about "ERROR" - what error description is in "Model" column (screenshot, maybe?)?
-
Sounds good on the link, thanks!
As for model / details, here you go (copy / paste, sorry) …
Monitoring Model Status
Local UPS UPS CP600 On Line
Battery Charge Time Remain Battery Voltage
left barred bargray barright bar
100% 0h 52m 0s 13.3 V
Load Input Voltage Output Voltage
left barred bargray barright bar
20% 121.0 V 121.0 V
Monitoring Model Status
Local UPS OL ERRORThanks again - this is great!
-
…..
Monitoring Model Status
Local UPS UPS CP600 On Line
Battery Charge Time Remain Battery Voltage
left barred bargray barright bar
100% 0h 52m 0s 13.3 V
Load Input Voltage Output Voltage
left barred bargray barright bar
20% 121.0 V 121.0 V
Monitoring Model Status
Local UPS OL ERRORIf being seen this also.
But then I discovered something strange with
/usr/local/www/widgets/widgets/ups.widget.php
It contained twice all the instructions !!
It start with/* $Id$ Copyright 2008 Seth Mos Part of pfSense widgets (www.pfsense.com) ....
If you find the same sequence half way the file, you have everything doubled … and the widget tries to show something that doesn't exists.
I removed this second part - and the error disappeared.
-
Yep, that fixes it - thanks!
Sounds like some feedback for the person generating the patches - minor mod needed.
Awesome!
-
The patches are just fine. You applied the same patch twice.
-
Hmmm … I did test and then apply, but I could have double clicked. That is possible, won't say it's not ... :).
But a patch should fail if applied twice, no?
Thanks!
-
But a patch should fail if applied twice, no?
Hmmm, no, not with a patch on non-existent file.
-
Agreed! I guess the patch is just "adding" - makes sense.
Thanks!
-
NUT Dashboard Widget (2.2.4)
Hi, all.
New version of my previous UPS widget. Now, no need to patch system files (runs as standalone widget).
Tested only on pfSense 2.2.4. You can apply patches from:UPS widget (main file): https://github.com/pfsense/pfsense/commit/d7ecd47fe1b080dfa85c6e22d96ce5e6fef86195.patch
UPS widget ('inc' file): https://github.com/pfsense/pfsense/commit/cbad7005fb804cd1065c97966550d2270c2eee76.patch
UPS widget ('js' file - ajax): https://github.com/pfsense/pfsense/commit/2816375af13a08d16375f4ca3603ac3f1edcfe6b.patchTesting and comments are wellcome.
WARNING! Patches are points wrong by default to "/src/usr/…" path (testing - "Patching file src/usr/local/www/widgets/widgets/ups_status.widget.php" and so on). I think this is because of github pfsense repository structure. Who know how to change this in patch automaticaly (to "/usr/..."), tell me. For workaround: create patch, fetch its contents, edit and remove "URL/Commit ID" and then remove from contents "src/" substring. Then apply patch.
In system will be created files:
/usr/local/www/widgets/widgets/ups_status.widget.php
/usr/local/www/widgets/include/ups_status.inc
/usr/local/www/widgets/javascript/ups_status.js
You can safely delete "*.orig" version of this files (zero-length file). -
Thanks!
Do the old patches need to be reverted, or rather just remove them and reboot -> then install the new ones?
Thanks again.
-
Thanks!
Do the old patches need to be reverted, or rather just remove them and reboot -> then install the new ones?
Thanks again.
Old patches needs to be reverted. But "system patches" package not allways can revert patch automaticaly. Therefore manual intervention can be needed.
-
Makes sense - thanks again for the awesome widget!
-
Removed the old patches, installed the new ones -> not working for me now … :(.
Have others tried this out?
Thanks.
-
Removed the old patches, installed the new ones -> not working for me now … :(.
Have others tried this out?
Thanks.
Read my "warning" notes from initial post (#26) about wrong path in patches and how to workaround this. For me this workaround works.
-
Sorry, missed the note … :(. Yep, works now - though I have 2 UPS Status widgets available afterwards.
Thanks.
-
Sorry, missed the note … :(. Yep, works now - though I have 2 UPS Status widgets available afterwards.
If you see two versions of widget - old and new, it mean that old version was not removed by reverting and removing old patches. And you need manualy remove it.
Old widget parts is (see patch contents):
/usr/local/www/widgets/widgets/ups.widget.php
/usr/local/www/widgets/include/ups.inc
$stats['nut'] = get_nutstats(true); + function get_nutstats() - in /usr/local/www/includes/functions.inc.php
updateNutStats(values[14]); + function updateNutStats(x) - in /usr/local/www/javascript/index/ajax.js -
Nope - none of these items are there. But not a biggie. Thanks!
-
Widget was merged to NUT package!
If you have installed old or new version of widget, remove it:
1. Revert and remove patches.
2. Verify to remove widget parts if it`s not removed by patches:
a) old version, remove:
/usr/local/www/widgets/widgets/ups.widget.php (and ups.widget.php.orig if exist)
/usr/local/www/widgets/include/ups.inc (and ups.inc.orig if exist)
$stats['nut'] = get_nutstats(true); + function get_nutstats() - in /usr/local/www/includes/functions.inc.php (backup and remove functions.inc.php.orig if exist - important system file)
updateNutStats(values[14]); + function updateNutStats(x) - in /usr/local/www/javascript/index/ajax.js (backup and remove ajax.js.orig if exist - important system file)b) new version, remove:
/usr/local/www/widgets/widgets/ups_status.widget.php (and ups_status.widget.php.orig if exist)
/usr/local/www/widgets/include/ups_status.inc (and ups_status.widget.php.orig if exist)
/usr/local/www/widgets/javascript/ups_status.js (and ups_status.js.orig if exist)3. After that you can update your nut package and add "UPS Status" widget to dashboard.
-
Works pretty well, finally can drop the local patches. 8)
-
Works great - thanks!!!