September 9, 200817 yr Am I doing it right? From root@Tower:/boot/unmenu_awk5# awk -W re-interval -f unmenu.awk Then point my browser to http://tower:8080 I cannot get the page load.. What I am doing wrong? Thanks!
September 9, 200817 yr Am I doing it right? From root@Tower:/boot/unmenu_awk5# awk -W re-interval -f unmenu.awk Then point my browser to http://tower:8080 I cannot get the page load.. What I am doing wrong? Thanks! looks correct, but I am assuming the files are in /boot/unmenu_awk5 and that you "cd /boot/unmenu_awk5" and that your unRAID array is started. I'm also assuming you did not name your server something other than "tower" It you did, //tower:8080 will never work. What happens when you type the awk -W re-interval -f unmenu.awk command? Type ls -al /boot/unmenu_awk5 I'd like to see the directory listing. Edit: I downloaded the last zip file I had posted, unzipped it to a unmenu_awk5 folder like you, and here is the result. Yours should look similar. [pre]root@Tower:/boot/unmenu_awk5# ls -al total 192 drwxr-xr-x 2 root root 16384 Sep 9 06:12 ./ drwxr-xr-x 11 root root 16384 Sep 9 06:12 ../ -rwxr-xr-x 1 root root 1106 Aug 19 00:13 10-unmenu-links.awk* -rwxr-xr-x 1 root root 3229 Sep 4 08:14 15-unmenu-syslog.awk* -rwxr-xr-x 1 root root 2746 Aug 28 23:45 20-unmenu-usage.awk* -rwxr-xr-x 1 root root 2236 Aug 26 23:25 25-unmenu-dupe_files.awk* -rwxr-xr-x 1 root root 14996 Sep 7 21:05 30-unmenu-file_browser.awk* -rwxr-xr-x 1 root root 1119 Sep 7 22:39 35-unmenu-apcupsd-status.awk* -rwxr-xr-x 1 root root 54552 Sep 8 13:47 unmenu.awk* root@Tower:/boot/unmenu_awk5# root@Tower:/boot/unmenu_awk5# awk -W re-interval -f unmenu.awk [/pre] Joe L.
September 9, 200817 yr Can somebody confirm the last version of the "awk" based web-server I posted as unmenu_awk5.zip works for them. Joe L.
September 9, 200817 yr Author Just a comment.. Would it make more sense to use a C syntax for defining internal variables rather then a comment syntax. I.E. #define ADD_ON_MENU Top Processes vs #ADD_ON_MENU=Top Processes This way it's clear in the code that this is a definition and not a comment. I have not gotten to play with this yet Joe... I've had my hands in the nitty gritty of unraid's kernel and also testing/configuring rtorrent with XMLRPC... Got rtorrent working with wtorrent the other day.. woo hoo.. GREAT WORK JOE! [:thumbsup:] BTW, you if you look at my powerdown tgz there is a slackbuild in it which could provide examples for you to set this up as an installable package. Within the doinst.sh you could do the automatic updating and/or starting of this tool. Use my rc.unRAID as a small skeleton of a rc startup shell.
September 9, 200817 yr root@Tower:~# ls -al /boot/unmenu_awk5 total 100 drwxr-xr-x 2 root root 4096 Sep 9 01:37 ./ drwxr-xr-x 5 root root 4096 Sep 9 01:37 ../ -rwxr-xr-x 1 root root 1106 Aug 18 23:13 10-unmenu-links.awk* -rwxr-xr-x 1 root root 3229 Sep 4 07:14 15-unmenu-syslog.awk* -rwxr-xr-x 1 root root 2746 Aug 28 22:45 20-unmenu-usage.awk* -rwxr-xr-x 1 root root 2236 Aug 26 22:25 25-unmenu-dupe_files.awk* -rwxr-xr-x 1 root root 14996 Sep 7 20:05 30-unmenu-file_browser.awk* -rwxr-xr-x 1 root root 1119 Sep 7 21:39 35-unmenu-apcupsd-status.awk* -rwxr-xr-x 1 root root 54552 Sep 8 12:47 unmenu.awk* root@Tower:~# cd /boot/unmenu_awk5 root@Tower:/boot/unmenu_awk5# awk -W re-interval -f unmenu.awk That's how exactly my screen look like. My server array is running while i am doing this. Server name is "tower"; standard unRAID page works on http://tower/. I also tried ip address http://192.168.111.14:8080 What happens when you type the awk -W re-interval -f unmenu.awk command? It's exactly like what posted above, seemed working - Ctl-C (to stop)... will bring the prompt bacK. Thanks!
September 9, 200817 yr Just a comment.. Would it make more sense to use a C syntax for defining internal variables rather then a comment syntax. I.E. #define ADD_ON_MENU Top Processes vs #ADD_ON_MENU=Top Processes This way it's clear in the code that this is a definition and not a comment. Good point... I can change it for the next version... It makes the parsing a tiny bit more complicated, but not too much more. I can no longer use the "=" to split the variable name from the value. If I just use "split" it will make multi-word values into multiple array members. I'll just have to hand-parse the line. Let me give some thought about how to best make the transition. I was thinking of a way to have local preferences in a separate config file so no editing of the main deployed files is needed. I'll probably see if I can combine the two concepts. I have not gotten to play with this yet Joe... I've had my hands in the nitty gritty of unraid's kernel and also testing/configuring rtorrent with XMLRPC... Got rtorrent working with wtorrent the other day.. woo hoo.. Ok, so you have some lame excuse of needing some time to eat, sleep, shower.... GREAT WORK JOE! [:thumbsup:] Did you give it a try? BTW, you if you look at my powerdown tgz there is a slackbuild in it which could provide examples for you to set this up as an installable package. Within the doinst.sh you could do the automatic updating and/or starting of this tool. Use my rc.unRAID as a small skeleton of a rc startup shell. So far, it is not a real package.... just a neat utility. Once we get a true "folder hierarchy" solidly defined, it will be easy. Joe L.
September 9, 200817 yr root@Tower:~# ls -al /boot/unmenu_awk5 total 100 drwxr-xr-x 2 root root 4096 Sep 9 01:37 ./ drwxr-xr-x 5 root root 4096 Sep 9 01:37 ../ -rwxr-xr-x 1 root root 1106 Aug 18 23:13 10-unmenu-links.awk* -rwxr-xr-x 1 root root 3229 Sep 4 07:14 15-unmenu-syslog.awk* -rwxr-xr-x 1 root root 2746 Aug 28 22:45 20-unmenu-usage.awk* -rwxr-xr-x 1 root root 2236 Aug 26 22:25 25-unmenu-dupe_files.awk* -rwxr-xr-x 1 root root 14996 Sep 7 20:05 30-unmenu-file_browser.awk* -rwxr-xr-x 1 root root 1119 Sep 7 21:39 35-unmenu-apcupsd-status.awk* -rwxr-xr-x 1 root root 54552 Sep 8 12:47 unmenu.awk* root@Tower:~# cd /boot/unmenu_awk5 root@Tower:/boot/unmenu_awk5# awk -W re-interval -f unmenu.awk That's how exactly my screen look like. My server array is running while i am doing this. Server name is "tower"; standard unRAID page works on http://tower/. I also tried ip address http://192.168.111.14:8080 What happens when you type the awk -W re-interval -f unmenu.awk command? It's exactly like what posted above, seemed working - Ctl-C (to stop)... will bring the prompt bacK. Thanks! Sounds to me like it should be working... Do you have perhaps a firewall (most likely) that might be blocking you? after you start the awk web-server, from your PC, can you open up a dos command window and then, in it, type: telnet tower 8080 GET / What happens? Joe L.
September 9, 200817 yr Do you have perhaps a firewall (most likely) that might be blocking you? Thanks Joe! You're right I forgot I have firewall.. Its working for me now! It looks great! Thanks you very much for your hard work and for sharing. ;D
September 9, 200817 yr Joe, I am forseeing a very crowded screen after adding a few plugins. I suggest it needs some form of tiered or hierarchical menu.. such as items 10, 20, 30, 40, etc., showing across the top as containers, .... and then items 21,22,23,24, etc are under tab 20... 31,32,33 under tab 30, etc. This would be generally done with a set of divs, with javascript toggling the visibility property.
September 9, 200817 yr Author Just a comment.. Would it make more sense to use a C syntax for defining internal variables rather then a comment syntax. I.E. #define ADD_ON_MENU Top Processes vs #ADD_ON_MENU=Top Processes This way it's clear in the code that this is a definition and not a comment. Good point... I can change it for the next version... It makes the parsing a tiny bit more complicated, but not too much more. I can no longer use the "=" to split the variable name from the value. If I just use "split" it will make multi-word values into multiple array members. I'll just have to hand-parse the line. Let me give some thought about how to best make the transition. I was thinking of a way to have local preferences in a separate config file so no editing of the main deployed files is needed. I'll probably see if I can combine the two concepts. Could it be done with a regex ? (^#define)\s([A-Za-z0-9]+)\s(.*) Ok just a quick toss at it... it probably won't work.. But it's an idea. you would think I know what I'm doing since I've been playing with the C regcom/regexec library all day sheesh.. (ma head is spinning).
September 10, 200817 yr Just a comment.. Would it make more sense to use a C syntax for defining internal variables rather then a comment syntax. I.E. #define ADD_ON_MENU Top Processes vs #ADD_ON_MENU=Top Processes This way it's clear in the code that this is a definition and not a comment. Good point... I can change it for the next version... It makes the parsing a tiny bit more complicated, but not too much more. I can no longer use the "=" to split the variable name from the value. If I just use "split" it will make multi-word values into multiple array members. I'll just have to hand-parse the line. Let me give some thought about how to best make the transition. I was thinking of a way to have local preferences in a separate config file so no editing of the main deployed files is needed. I'll probably see if I can combine the two concepts. Could it be done with a regex ? (^#define)\s([A-Za-z0-9]+)\s(.*) Ok just a quick toss at it... it probably won't work.. But it's an idea. you would think I know what I'm doing since I've been playing with the C regcom/regexec library all day sheesh.. (ma head is spinning). I grew up with libPW, "PW" as in Pete Weinburger, as in the "W" in "aWk"... the guy who wrote the original regex routines. It might work with a regular expression. I think the gawk "match" function fills in an optional third argument as an array of matched values and lengths. To be honest, I've only read about it... but then, I'm one of the odd people who RTFM. Not sure of the "^" though... in awk, that usually means the beginning of the FILE, not the beginning of a LINE, so I'll need to experiment a tiny bit to see how it works with "match()" Joe L. Isn't it odd to be considered an "expert" because you read about something once? ???
September 10, 200817 yr Author Isn't it odd to be considered an "expert" because you read about something once? ??? Maybe it has to do with how long ago you read it? LOL!!!
September 10, 200817 yr WeeboTech, Have you been able to "eat", "sleep", "shower", check out/test the "awk" server pages? Obviously, you looked at the plug-in code (or lack thereof) Joe L.
September 10, 200817 yr Author Not yet, but I'm using the shell based unMENU LOL!!! I'm testing unRAID's performance with RAID0 on the parity drive to see if it will boost write performance. Only 753 more minutes to finish initializing with the 2TB RAID0 parity drive
September 10, 200817 yr Isn't it odd to be considered an "expert" because you read about something once? ??? Maybe it has to do with how long ago you read it? LOL!!! Or that you remembered reading it at all... The immediately intuitive syntax is: [pre] match( line , /^(#ADD_ON_HTTP_HEADER|#define\WADD_ON_HTTP_HEADER)([ =]+)(.+)/, c) if ( c[1,"length"] > 0 && c[2,"length"] > 0 && c[3,"length"] > 0 ) { add_on_http_header = substr(line,c[3,"start"],c[3,"length"]) } [/PRE] The array subscripting is unique. In awk, all array subscripts are strings. The string concatenation of 3, "start" = "3 start" which is the actual array subscript since awk only has single dimension arrays, but acts as if it has a two dimensional array. 3, "start" is more readable.. so it is more commonly used. There... now you too "is" an expert. Oh yes, the regex pattern allows either the old style OR the new style of defined variables in the plug-ins. Any of the following will work: #ADD_ON_MENU=File Browser #ADD_ON_MENU File Browser #define ADD_ON_MENU File Browser #define ADD_ON_MENU=File Browser #define ADD_ON_MENU = File Browser I'll change my included sample plug-in's, but plug-in's written by others, based on my earlier samples, will keep working. Joe L.
September 10, 200817 yr Not yet, but I'm using the shell based unMENU LOL!!! Not yet as in No food... or No nap... or No bath... or no "awk based server" I'm testing unRAID's performance with RAID0 on the parity drive to see if it will boost write performance. Only 753 more minutes to finish initializing with the 2TB RAID0 parity drive I think write performance is limited by the exclusive lock placed by reiserfs and/or the "md" driver blocking all network I/O while writing to the file system. (I'm guessing reiserfs is the one getting the kernel level lock) It should NOT be blocking network I/O until it is unable to keep up with the network rate with multiple pdflush processes. As it is, it seems to block all I/O when any pdflush is actively writing. Now that you have 753 minutes to spare, try out the awk based web-server, after you eat, shower & sleep as appropriate
September 14, 200817 yr Admittedly I haven't read every post in this thread, but I did scan through all of them and I can't find where it says how to install this. This looks like a great tool and I'd love to try it out, but I'm not sure how. I downloaded the files, but what do I do with them?
September 14, 200817 yr Joe, can I suggest that you add a feature to the array management page: fuser -v /mnt/disk* When unRAID won't shut down, this is helpful to determine what is preventing it .... as well as checking to see if there are things open that you want to close cleanly BEFORE shutting down. You could also include a button to kill processes accessing the unRAID mount points (fuser -km /dev/disk*) .... or better yet "FORCE unRAID SHUTDOWN" by calling the "/etc/rc.d/rc.unRAID stop" script. Those are the main two things I still end up having to telnet to the server to do.... everything else I can do via the web interface or via a mapped drive.
September 14, 200817 yr Admittedly I haven't read every post in this thread, but I did scan through all of them and I can't find where it says how to install this. This looks like a great tool and I'd love to try it out, but I'm not sure how. I downloaded the files, but what do I do with them? unzip the files into a folder on the flash drive. I just have them at /boot log in via telnet change directory to that folder (assuming the files are at /boot) type : cd /boot awk -W re-interval -f unmenu.awk the "awk" based server will start and not return to a prompt until you type "Control-C" to interrupt it. If you need to do anything else at the command line, open another telnet session. At a later point, we'll figure the best way to start this up automatically so it won't tie up a telnet session. Then, at the browser on your PC, type //tower:8080/ Have fun... Joe L.
September 14, 200817 yr Joe, can I suggest that you add a feature to the array management page: fuser -v /mnt/disk* When unRAID won't shut down, this is helpful to determine what is preventing it .... as well as checking to see if there are things open that you want to close cleanly BEFORE shutting down. You could also include a button to kill processes accessing the unRAID mount points (fuser -km /dev/disk*) .... or better yet "FORCE unRAID SHUTDOWN" by calling the "/etc/rc.d/rc.unRAID stop" script. Those are the main two things I still end up having to telnet to the server to do.... everything else I can do via the web interface or via a mapped drive. My current "button" to stop the server includes using fuser and killing off processes on the /mnt/disk and /mnt/user shares. Your idea of a way to learn of existing processes before killing them, so you can terminate them before a shutdown is a good one. I'll do something in a new plug-in and you can try it out. If you have the newest version of the unmenu.awk, all you need are the following 4 lines in a new file you can create to write your own plug-in for fuser. name the file 60-unmenu-fuser.cgi Use an editor that does not put carriage returns. or if you cannot see this tip on how to remove them: http://lime-technology.com/wiki/index.php?title=FAQ&curid=1421&diff=2280&oldid=2275#Why_do_my_scripts_have_problems_with_end-of-lines.3F put these 4 lines in the 60-unmenu-fuser.cgi file: #define ADD_ON_MENU Active Proceses #define ADD_ON_URL fuser echo "<pre>" fuser -mv /mnt/disk*/ /mnt/user/* 2>&1 Then, stop and re-start the unmenu.awk server. It will see the new ".cgi" file and give you a new menu choice. It is that easy... Joe L.
September 15, 200817 yr As I posted earlier, I think the menu is going to get crowded fast, so here an improved sysinfo plugin that combines: * CPU info * Process info * FUser info * Ethernet info * Uptime * Top * UPS Status
September 15, 200817 yr As I posted earlier, I think the menu is going to get crowded fast, so here an improved sysinfo plugin that combines: * CPU info * Process info * FUser info * Ethernet info * Uptime * Top * UPS Status You are correct, it will get crowded, especially with how easy it is to make a new plug-in a functional part of the unmenu browser. I like what you did a lot. Many thanks... I did make a few tiny changes, mostly cosmetic, and one tiny functional change: the fuser command should be invoked with -mv If not, it will not pick up the processes correctly. (does not detect if I cd /mnt/disk11 , and other smbd processed accessing /mnt/user folders. I changed the fuser command line from cmd = "fuser -v /mnt/disk* /mnt/user/* 2>&1" to cmd = "fuser -mv /mnt/disk* /mnt/user/* 2>&1" I added a horizontal rule across the top to separate the buttons from the top menu choices: I changed: pageoptions = "<form method=\"GET\" ><table>" to pageoptions = "<hr><form method=\"GET\" ><table>" and lastly, I changed theHTML = theHTML "<strong>you don't appear to have a UPS monitoring program installed</strong><pre>" to theHTML = theHTML "<strong>you don't appear to have an APC UPS monitoring program installed</strong><pre>" Oh, yeah, the comment for the user pressed "Top processes" is a cut/paste error... still says original comment. I fixed it too and also added a new line at the top of the file to hold the version. It is: #define ADD_ON_VERSION 1.0 - contributed by bubbaQ Thanks once more... It is a nice bit of coding to tie together a lot of simple commands that give information about out systems. I'll include your sys_info plug-in in my next zip file. (due out shortly, once I get some more un-assigned disk management functions implemented.) I've been very busy with adding a lot of neat stuff. Soon I'll be able to mount and share an un-assigned USB drive, even if it has an NTFS file system. It won't be protected by parity, but it will ease file migration. Main page now has information on Flash drive, cache drive, and last 5 lines of syslog. Joe L. (I used to love code review sessions...)
September 15, 200817 yr Mount and share other devices is very useful, not just for flash. I run unRAID from disk on a full Slackware development system, so I have a script that shares the root fs, but it is a pain since stopping and starting the array will require me to rerun the script via telnet.
September 15, 200817 yr Mount and share other devices is very useful, not just for flash. I run unRAID from disk on a full Slackware development system, so I have a script that shares the root fs, but it is a pain since stopping and starting the array will require me to rerun the script via telnet. I did not think about the root file-system. Good idea to make it a possible share, and possibly to report on it on the main page. Since it is in RAM (on almost all systems) it will certainly be interesting to some to see its as file-system. Perhaps as a two step process. Mount it, and then allow SAMBA sharing of any mounted file system. If you can mount it, we'll show it as a possible share, if not already shared. (once I figure out how to determine all that stuff ) Joe L.
September 15, 200817 yr Since we are going to muck with the Samba shares, seems a good opportunity to change the create and directory masks from the brain-dead values emhttp creates.
Archived
This topic is now archived and is closed to further replies.