Closed spacecabbie closed 6 years ago
Fixed this previously but never committed. npm i
should work now
Awesome i think i got it working one question though in the injectTempGUI.sh on line 4 it links to the jail nginx.conf since it was not created there i cp the original from the main system is that correct ? Ifso may i suggest you ad that step in the read me ?
Awesome nice little script thanks ! wiert its not default in freenas to monitor temps though.
I know right, seems like such a basic thing!
I'm also working on adding updating for the FreeNAS UI too (step 4) as that is overwritten when FreeNAS is updated.
Roger i put a watch on update of this project :)
Hi just a small update the script runs fine but the conf file reverted nonetheless today. Output:
root@FileServer:~ # /root/scripts/injectTempGUI.sh
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Stopping nginx.
Waiting for PIDS: 90912.
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Starting nginx.
root@FileServer:~ #
Any idea how i could go about troubleshooting this ?
Hmm. You've got your cron job set up, right? When you ran the above output, did it update the conf for you? If you run it again, does it restart nginx again, or does it finish with No need to update
?
Yea the cron job is setup when i run it repeatedly it keeps doing that. no changes are written but it dus restarts nginx
root@FileServer:~ # /root/scripts/injectTempGUI.sh
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Stopping nginx.
Waiting for PIDS: 41217.
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Starting nginx.
root@FileServer:~ # /root/scripts/injectTempGUI.sh
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Stopping nginx.
Waiting for PIDS: 44022.
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Starting nginx.
root@FileServer:~ # /root/scripts/injectTempGUI.sh
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Stopping nginx.
Waiting for PIDS: 44127.
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Starting nginx.
root@FileServer:~ # /root/scripts/injectTempGUI.sh
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Stopping nginx.
Waiting for PIDS: 44158.
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Starting nginx.
root@FileServer:~ #
Sorry for the delay.
Hmm, can you please try updating to this index.js. I don't think the updated nginx config was being written to disk before being copied back to your actual nginx.conf.
Thats ok i am not in a hurry. Exact same out put though :( I did remove the conf file on the jail to see if the script would make it this time it game a error the html file was not there so i made a blank one. no error on the conf file and it was also not created in the jail dir.
root@FileServer:~ # /root/scripts/injectTempGUI.sh
Adding to UI Template
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Stopping nginx.
Waiting for PIDS: 62871.
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Starting nginx.
root@FileServer:~ # /root/scripts/injectTempGUI.sh
Adding to UI Template
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Stopping nginx.
Waiting for PIDS: 70647.
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Starting nginx.
Hi i was busy so it took me a while to look at this problem again it seems the error is in index.js when i run it standalone in the jail it gives me:
root@nzbget:/usr/local/freenastemp # ./index.js ./index.js: 1: Syntax error: "(" unexpected
You'll have to run it as node ./index.js
, but it'll need the index.html
from the reports page and the nginx.conf
file to run properly.
Can you paste your FREENASUI
and FREENASUIJAIL
paths that are in injectTempGUI.sh
(lines 5-6) along with your FREENASUI
file. I'm guessing it isn't pointing to the correct file.
injectTempGUI.sh file: `
NGINX=/usr/local/etc/nginx/nginx.conf #Path of nginx.conf on your FreeNAS System NGINXJAIL=/mnt/BlackHole/jails/nzbget/usr/local/freenastemp/nginx.conf #Path of temporary nginx.conf in jail (relative to FreeNAS, not jail) FREENASUI=/usr/local/www/freenasUI/templates/reporting/index.html #Path of UI Template on FreeNAS FREENASUIJAIL=/mnt/BlackHole/jails/nzbget/usr/local/freenastemp/index.html #Path of temporary UI Template in jail (relative to FreeNAS, not jail) JAIL=nzbget #Name of your jail (Jails->Jails in FreeNAS UI list the names) JAILSCRIPT=/usr/local/freenastemp/index.js #Path of node script (relative to jail)
cp $NGINX $NGINXJAIL; cp $FREENASUI $FREENASUIJAIL; chmod o+rw $NGINXJAIL; chmod o+rw $FREENASUIJAIL; jexec $JAIL node $JAILSCRIPT; ECODE=$? if [ $ECODE -eq 0 ]; then cp $NGINXJAIL $NGINX && cp $FREENASUIJAIL $FREENASUI && rm $NGINXJAIL && rm $FREENASUIJAIL && service nginx restart exit $?; elif [ $ECODE -eq 1 ]; then echo "No need to update"; exit 0; else echo "Error" >&2; exit $ECODE; fi ` index.html https://pastebin.com/uVNA0c04
fyi only the nginx part seems to fail cause the script did detect the index.html pard i had this issue before you updated to include the index.html edit.
Ah ha, okay, so!
That index.html
file should be sitting in the same directory as your graphs output. The index.html
file that should be at /usr/local/www/freenasUI/templates/reporting/index.html
is the one generated by FreeNas/Dojo and looks something like (on FreeNAS-11.0-U4 (54848d13b)):
<div data-dojo-type="dijit.layout.TabContainer" data-dojo-props="nested:true, title: '{% trans "Reporting"|escapejs %}', doLayout: true" style="width: 100%;">
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="title: '{% trans "CPU" %}', href: '{% url "reporting_cpu" %}', refreshOnShow: true"></div>
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="title: '{% trans "Disk" %}', href: '{% url "reporting_disk" %}', refreshOnShow: true"></div>
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="title: '{% trans "Memory" %}', href: '{% url "reporting_memory" %}', refreshOnShow: true"></div>
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="title: '{% trans "Network" %}', href: '{% url "reporting_network" %}', refreshOnShow: true"></div>
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="title: '{% trans "Partition" %}', href: '{% url "reporting_partition" %}', refreshOnShow: true"></div>
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="title: '{% trans "System" %}', href: '{% url "reporting_system" %}', refreshOnShow: true"></div>
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="title: '{% trans "Target" %}', href: '{% url "reporting_target" %}', refreshOnShow: true"></div>
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="title: '{% trans "ZFS" %}', href: '{% url "reporting_zfs" %}', refreshOnShow: true"></div>
</div>
So, my suggested fix is to:
/usr/local/www/freenasUI/templates/reporting/index.html
to where rdd-graph.sh
is generating your graphs.index.js
to be the directory you just moved index.html to in step 1./usr/local/www/freenasUI/templates/reporting/index.html
with the code block above (hopefully you're on a similar enough version, or maybe FreeNAS will regenerate it for you).Fair point i'll have to double check that but the problem i am having is the nginx.conf is not being updated. nevertheless i shall apply above fix.
How'd you go with this @spacecabbie?
I get the following error when i run "npm i"
full log output below