iStatServer on unRAID?


Recommended Posts

everything broke really bad when they started only using the new .txz compression format.  That is only supported on the newest releases of unRAID.  (And many people are still running older versions of unRAID that only support .tgz install packages.) 

That's easily remedied by installing the xz package and updating the installpkg script on those unRAID versions that don't know the .txz format.

We can even make that a unMENU addon.

Not a bad idea to have an unMENU package to update to the new installpkg and install the new xz compression utility.
Link to comment
  • Replies 105
  • Created
  • Last Reply

Top Posters In This Topic

No worries Joe L, I'll try the update for unMENU at my earliest convenience and see if all goes well. I've got to say that the iStat monitoring tool is quite handy indeed, a very nice and clean layout of your unraid server, which is all you'd need to see how its running.

Given that others have mentioned that you cannot sign onto the unraid's default main web gui, it is difficult to monitor your unraid server from the couch without (well in my case):

 

either terminal services to my management server via my iphone (somewhat cumbersome) or

 

use my laptop (again, cumbersome).

 

The unMENU addon gives me access to the web gui (only using unMENU of course) via my iPhone. Before I got into unMENU and iStat, I only had a couple of options to access my rig (which as mentioned, not the best method), now I have iStat, unMENU and terminal service via a free iPhone app to execute the 'powerdown' command too, all from the iPhone (Kind of like a universal remote control for unraid ;D ). iStat and unMENU being graphical are no doubt better to interface and work with. Thanks to all who dedicate their time and efforts to get these fine pieces of software up and running. They say the best things in life are free, and it is true :)

 

Update: I just got iStat Server to work on my test rig. It is nothing short of being Very Impressive. For some reason, the install for iStat Server needed me to install the libxml2-2.6.31 package (I thought that it would of installed this as a dependancy, was it suppose to?). Anyways, I got it installed with the steps below:

 

cd /boot/packages

wget http://slackware.cs.utah.edu/pub/slackware/slackware-12.1/slackware/l/libxml2-2.6.31-i486-2.tgz

echo 'installpkg /boot/packages/libxml2-2.6.31-i486-2.tgz' >> /boot/config/go

 

Upon doing the above, the iStat Server was only then able to install and run successfully. I must say that I've very happy with getting this going and I will have to no doubt have to get this running on my production rig. I am very pleased with this and a Thanks is well deserved to starcat and all those who contributed to this thread.

 

I tried to install this via unmenu and I got a message that it is installed but I'm running a newer version, something  about 0.5.6 or something like that. I have unmenu 1.3 and unraid 4.5.1. I'll get the exact message and post it (doesn't seem to be an error as such), though I can't get my iphone to see the server too. I'll reboot it and try again as I just installed it. I'll let you know whether it works or not.

The package-manager did not deal well with existing packages where an additional dependency  was subsequently added.  I think I fixed that yesterday, so you should be able to update your unMENU installation and then, if you desire, re-install from there.   

You should be able to download the newest unmenu_install from here: http://code.google.com/p/unraid-unmenu/

 

unzip it and put it in your /boot/unmenu directory.  Then:

cd /boot/unmenu

unmenu_install -u

 

Then, if it moves your edited istat server package to an old_unmenu sub-directory, you'll need to re-configure its config variables and re-install it.

( It probably will not move it, as it should ignore the lines in the .conf file you edited to configure it for your own use.)

 

Glad the iStat package is working for you.  (I don't have an iPhone, so I can't help you test it)

 

Joe L.

Link to comment

Question: What would be the way to get this installed without using unMENU? Can or would the following work to have istat working without unMENU?:

 

cd /boot/packages

wget http://slackware.cs.utah.edu/pub/slackware/slackware-12.1/slackware/l/libxml2-2.6.31-i486-2.tgz

echo 'installpkg /boot/packages/libxml2-2.6.31-i486-2.tgz' >> /boot/config/go

cd /boot/packages

wget http://members.chello.at/starcat/packages/istat-0.5.6.tgz

echo 'installpkg /boot/packages/istat-0.5.6.tgz' >> /boot/config/go

/usr/local/bin/istatd -d

 

making the libxml2-2.6.31 installed first and then the istat-0.5.6.tgz just after and issuing the 'istatd -d' to startup as a service? Please feel free to make any corrections to the above as I'd like to have this running as a service every time my server boots up. Thanks.

Link to comment

Question: What would be the way to get this installed without using unMENU? Can or would the following work to have istat working without unMENU?:

 

cd /boot/packages

wget http://slackware.cs.utah.edu/pub/slackware/slackware-12.1/slackware/l/libxml2-2.6.31-i486-2.tgz

echo 'installpkg /boot/packages/libxml2-2.6.31-i486-2.tgz' >> /boot/config/go

cd /boot/packages

wget http://members.chello.at/starcat/packages/istat-0.5.6.tgz

echo 'installpkg /boot/packages/istat-0.5.6.tgz' >> /boot/config/go

/usr/local/bin/istatd -d

 

making the libxml2-2.6.31 installed first and then the istat-0.5.6.tgz just after and issuing the 'istatd -d' to startup as a service? Please feel free to make any corrections to the above as I'd like to have this running as a service every time my server boots up. Thanks.

 

Put the line "/usr/local/bin/istatd -d" into your /boot/config/go file too.

 

In addition to this, after installing istat-0.5.6.tgz for the first time, edit /usr/local/etc/istat.conf and customize to your liking, then save it to /boot/config and put the following line in your /boot/config/go script right *after* installation of the istat-0.5.6.tgz package itself in order to overwrite the default config file with your customized version each time the package installs.

 

/bin/copy /boot/config/istat.conf /usr/local/etc

 

 

Link to comment

Question: What would be the way to get this installed without using unMENU? Can or would the following work to have istat working without unMENU?:

 

cd /boot/packages

wget http://slackware.cs.utah.edu/pub/slackware/slackware-12.1/slackware/l/libxml2-2.6.31-i486-2.tgz

echo 'installpkg /boot/packages/libxml2-2.6.31-i486-2.tgz' >> /boot/config/go

cd /boot/packages

wget http://members.chello.at/starcat/packages/istat-0.5.6.tgz

echo 'installpkg /boot/packages/istat-0.5.6.tgz' >> /boot/config/go

/usr/local/bin/istatd -d

 

making the libxml2-2.6.31 installed first and then the istat-0.5.6.tgz just after and issuing the 'istatd -d' to startup as a service? Please feel free to make any corrections to the above as I'd like to have this running as a service every time my server boots up. Thanks.

If you do not wish to use unMENU itself, you can use the package.conf file, put the PACKAGE_VARIABLE and PACKAGE_INSTALLATION lines in a file as a shell script, edit them a tiny bit, and go from there

For the istat package, once you have downloaded the two .tgz files

you need to do the following  (all gotten from the unMENU package.conf file)   as you can see, a group of the lines edit the istat.conf file with the variables, but others create the needed user ID and group, create some needed directories, change the owner as needed of the istat command, and start the service.   It is not as easy as adding the two or three lines as you illustrated.  Of course, now that you see how it is done, you can create a shell script with these commands and do it all yourself... It is just that unMENU hid all the messy details from the less experienced users of linux.

Here is the script of commands needed to get the istat server running on unRAID.  the source for all the unmenu package files is here : http://code.google.com/p/unraid-unmenu/source/browse/#svn/trunk

The specific package file for the iStat server is here:

http://code.google.com/p/unraid-unmenu/source/browse/trunk/istat-unmenu-package.conf

 

Have fun,  All you need to do is edit the top 6 lines to set the variables to the values you desire.  the resulting set of commands will be identical to the .manual_install or .auto_install file you would get if installed through the unMENU package manager.

Oh yes, the "vDISK variable assignment is all on one long line.

 

Joe L.

 

[pre]vCODE=12345

vNETPORT="5109"

vNETDEVICE="eth0"

vDISK="/mnt/user /boot /dev/md1 /dev/md2 /dev/md3 /dev/md4 /dev/md5 /dev/md6 /dev/md7 /dev/md8 /dev/md9 /dev/md10 /dev/md11 /dev/md12 /dev/md13 /dev/md14 /dev/md15 /dev/md16 /dev/md17 /dev/md18 /dev/md19 /dev/md20"

vLABEL="1"

vUSERLABEL="unRAID"

cd /boot/packages

killall istatd

installpkg libxml2-2.6.31-i486-2.tgz

installpkg istat-0.5.6.tgz

sed -i -e "s/^server_code            12345/server_code            ${vCODE-12345}/" /usr/local/etc/istat.conf

sed -i -e "s/^network_port           5109/network_port           ${vNETPORT-5109}/" /usr/local/etc/istat.conf

sed -i -e "s/^monitor_disk             ( \/ )//" /usr/local/etc/istat.conf

sed -i -e "s/^network_addr           192.168.50.67/#network_addr 127.0.0.1/" /usr/local/etc/istat.conf

sed -i -e "s/^monitor_net              ( eth0 )/monitor_net              ( ${vNETDEVICE-eth0} )/" /usr/local/etc/istat.conf

sed -i -e "s/^disk_mount_path_label    0/disk_mount_path_label    ${vLABEL-1}/" /usr/local/etc/istat.conf

sed -i -e "s/^# End of file//" /usr/local/etc/istat.conf

sed -i -e "s/^# Array of disks to monitor. Specify mount path or device name.//" /usr/local/etc/istat.conf

echo "# Set custom disk label. Will override all other labels." >> /usr/local/etc/istat.conf

echo "disk_rename_label /mnt/user \"${vUSERLABEL-unRAID}\"" >> /usr/local/etc/istat.conf

echo "" >> /usr/local/etc/istat.conf

echo "# Array of disks to monitor. Specify mount path or device name." >> /usr/local/etc/istat.conf

echo "monitor_disk ( ${vDISK-/mnt/user} )" >> /usr/local/etc/istat.conf

echo "" >> /usr/local/etc/istat.conf

echo "# End of autogenerated file. Do not edit by hand." >> /usr/local/etc/istat.conf

/usr/sbin/useradd istat 2>/dev/null

/usr/sbin/groupadd istat 2>/dev/null

[ ! -d /var/run/istat/ ] && mkdir /var/run/istat

[ ! -d /var/run/istat/cache/ ] && mkdir /var/run/istat/cache

/usr/bin/chown -R istat:istat /var/run/istat

/usr/local/bin/istatd -d[/pre]

Link to comment

Thanks for the information. I'll have a go at it later today and report back if I get stuck. It kind of makes sense, though I have a question I need to raise. On the point of 'put the PACKAGE_VARIABLE and PACKAGE_INSTALLATION lines in a file as a shell script' from the istat-unmenu-package.conf file as part of the script that I need to create for the 'go' file, I can't distinguish the end of the PACKAGE_INSTALLATION section. The PACKAGE_VARIABLE (I believe) ends with the End of file//" /usr/local/etc/istat.conf<br></td></tr><trid=sl_svn42_29><td class="source">), is this correct? Sorry for the questions, thanks.

Link to comment

Thanks for the information. I'll have a go at it later today and report back if I get stuck. It kind of makes sense, though I have a question I need to raise. On the point of 'put the PACKAGE_VARIABLE and PACKAGE_INSTALLATION lines in a file as a shell script' from the istat-unmenu-package.conf file as part of the script that I need to create for the 'go' file, I can't distinguish the end of the PACKAGE_INSTALLATION section. The PACKAGE_VARIABLE (I believe) ends with the End of file//" /usr/local/etc/istat.conf<br></td></tr><trid=sl_svn42_29><td class="source">), is this correct? Sorry for the questions, thanks.

I'll illustrate with one of each of the two lines:

 

The original PACKAGE_VARIABLE line has three segments, we want the middle one, the other two are the label on the field in the unMENU package manager, and the associated description on the package-manager form.

PACKAGE_VARIABLE Network Port||vNETPORT=5109||The network port to use. The default is 5109.

It becomes

vNETPORT="5109"

You will want to add "quote marks" around the value if it has any embedded spaces.  Although not needed in this specific case for this value, the quote marks are needed for the vDISK variable or any variable with a value that has embedded spaces.  It does not hurt to always have them around the value. For this vDISK line, the edited version would become:

vDISK="/mnt/user /boot /dev/md1 /dev/md2 .... /dev/md19 /dev/md20"

(I edited out the middle set of disks, replacing them with ... to keep the line from wrapping on your screen. you would want all of them, or at least all on your server)

 

The second type of line is a PACKAGE_INSTALLATION line

One original is this

PACKAGE_INSTALLATION sed -i -e "s/^network_port          5109/network_port          ${vNETPORT-5109}/" /usr/local/etc/istat.conf

The new just omits the PACKAGE_INSTALLATION identifier at the beginning of the line and looks like this:

sed -i -e "s/^network_port          5109/network_port          ${vNETPORT-5109}/" /usr/local/etc/istat.conf

 

As I said, all the unMENU package file does is convert those two types of lines into a packagename.manual_install and packagename.auto_install file (they are identical)  All the other lines in the package file are used to download the correct package files and to present you with the description.  they also verify the installed version to keep you informed.  They are not needed for your simple installation from a "go" script.

 

The packagename.auto_install and packagename.manual_install scripts of commands are created in the /boot/packages directory.  Once they are there, you do not need to run unMENU any more.  It is done.  You can invoke either from your "go" script.  The only reason there are two is so I can identify those you desire to auto-re-install on re-boot.  (The auto_install file is only present for those your elected to auto-re-install)

 

As you edit the PACKAGE_INSTALLATION lines, keep the original spacing, especially for the "sed" lines, since they are searching for a specific pattern in the original file and replacing it with your variable from above.  It is not necessary to edit any of the PACKAGE_INSTALLATION lines to change the values shown there.  That is why I define the variables in the lines at the top of the script.

 

Joe L. 

Link to comment

Hi Joe L, I created a "istat.sh" (with the chmod setting to it '-rwxrwxrwx') file under the /boot/config directory:

 

vNETPORT="5109"

vDISK="/mnt/user /boot /dev/md1 /dev/md2 /dev/md3"

sed -i -e "s/^network_port 5109/network_port ${vNETPORT-5109}/" /usr/local /etc/istat.conf

 

but when I exectue the script, I get the follow error:

 

sed: couldn't edit /usr/local: not a regular file

 

My 'go' file has the following:

#!/bin/bash

# Start the Management Utility

/usr/local/sbin/emhttp &

sleep 30

for i in /dev/md*

do

    blockdev --setra 2048 $i

done

nohup awk -W re-interval -f listen.awk >/dev/null 2>&1 &

CTRLALTDEL=YES LOGSAVE=30 installpkg /boot/packages/powerdown-1.02-noarch-unRAID.tgz

sysctl -w kernel.poweroff_cmd="/sbin/powerdown"

echo "/boot/unmenu/uu" | at now + 1 minute

echo "powerdown" | at 23:59

cd /boot/packages && find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c

installpkg /boot/packages/libxml2-2.6.31-i486-2.tgz

installpkg /boot/packages/istat-0.5.6.tgz

/usr/local/bin/istat -d

/boot/config/istat.sh

 

Any ideas? Appreciate your help.

 

 

 

Link to comment

Hi Joe L, I created a "istat.sh" (with the chmod setting to it '-rwxrwxrwx') file under the /boot/config directory:

 

vNETPORT="5109"

vDISK="/mnt/user /boot /dev/md1 /dev/md2 /dev/md3"

sed -i -e "s/^network_port 5109/network_port ${vNETPORT-5109}/" /usr/local /etc/istat.conf

 

but when I exectue the script, I get the follow error:

 

sed: couldn't edit /usr/local: not a regular file

 

you have a space between the /usr/local and the/etc/istat.conf parts.  There is NOT supposed to be that space.

Link to comment

Hi Joe L, I created a "istat.sh" (with the chmod setting to it '-rwxrwxrwx') file under the /boot/config directory:

 

vNETPORT="5109"

vDISK="/mnt/user /boot /dev/md1 /dev/md2 /dev/md3"

sed -i -e "s/^network_port 5109/network_port ${vNETPORT-5109}/" /usr/local /etc/istat.conf

 

but when I exectue the script, I get the follow error:

 

sed: couldn't edit /usr/local: not a regular file

 

My 'go' file has the following:

#!/bin/bash

# Start the Management Utility

/usr/local/sbin/emhttp &

sleep 30

for i in /dev/md*

do

    blockdev --setra 2048 $i

done

nohup awk -W re-interval -f listen.awk >/dev/null 2>&1 &

CTRLALTDEL=YES LOGSAVE=30 installpkg /boot/packages/powerdown-1.02-noarch-unRAID.tgz

sysctl -w kernel.poweroff_cmd="/sbin/powerdown"

echo "/boot/unmenu/uu" | at now + 1 minute

echo "powerdown" | at 23:59

cd /boot/packages && find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c

installpkg /boot/packages/libxml2-2.6.31-i486-2.tgz

installpkg /boot/packages/istat-0.5.6.tgz

/usr/local/bin/istat -d

/boot/config/istat.sh

 

Any ideas? Appreciate your help.

 

 

 

As already posted, you have an extra space in the name of the file being edited.

 

Also, and more importantly, these two lines seem transposed in your "go" script.

 

/usr/local/bin/istat -d    <----- start the istat daemon process

/boot/config/istat.sh      <----- install and configure the istat daemon process

 

It appears as if you are invoking the  istat program BEFORE you are installing it.

Now, the last line in your istat.sh script might also be invoking "/usr/local/bin/istat -d" already.

In that case, the next to last line in your "go" script is not needed any longer.

 

Joe L.

Link to comment

I got it going. Basically I had to do the following:

 

The 'istat.sh' file below:

 

vNETPORT="5109"

vDISK="/mnt/user /boot shfs /dev/md1 /dev/md2 /dev/md3 /dev/md4 /dev/md5 /dev/md6 /dev/md7"

sed -i -e "s/^network_port 5109/network_port ${vNETPORT-5109}/" /usr/local/etc/istat.conf

 

The 'istat.conf' file below:

#

# /etc/istat.conf: Configuration for iStat server

#

 

network_addr          192.168.0.5

network_port          5109

server_code            12345

server_user            istat

server_group          istat

server_socket          /tmp/istatd.sock

server_pid            /var/run/istat/istatd.pid

cache_dir              /var/run/istat/cache

 

# Note: Only support for one network interface, limited by client.

monitor_net              ( eth0 )

 

# Array of disks to monitor. Specify mount path or device name.

monitor_disk            ( shfs /dev/md1 /dev/md2 /dev/md3 /dev/md4 /dev/md5 /dev/md6 /dev/md7 )

 

# Set to 1 if you want to use mount path as label instead of the device name.

disk_mount_path_label    0

 

# Try to probe the filesystem for disk label, will override the mount path label.

disk_filesystem_label    1

 

# Set custom disk label. Will override all other labels.

# disk_rename_label        /dev/sda1  "root"

# disk_rename_label        /home      "home"

 

# End of file

 

and the 'go' script file below:

#!/bin/bash

# Start the Management Utility

/usr/local/sbin/emhttp &

sleep 30

for i in /dev/md*

do

    blockdev --setra 2048 $i

done

nohup awk -W re-interval -f listen.awk >/dev/null 2>&1 &

CTRLALTDEL=YES LOGSAVE=30 installpkg /boot/packages/powerdown-1.02-noarch-unRAID.tgz

sysctl -w kernel.poweroff_cmd="/sbin/powerdown"

echo "powerdown" | at 23:59

ethtool -s eth0 wol g

/boot/config/mpc.sh

#/boot/config/s3.sh

installpkg /boot/packages/libxml2-2.6.31-i486-2.tgz

installpkg /boot/packages/istat-0.5.6.tgz

#installpkg /boot/packages/openssh-5.1p1-i486-1.tgz

/boot/config/istat.sh

cp /boot/config/istat.conf /usr/local/etc

/usr/local/bin/istatd -d &

 

I'm currently able the all my disks, the main mount share that all my disks fall under, CPU and RAM details. It is great tool to have, though I'd like to get the disk temps and fans RPM speeds in view as well. Is their something or other things I need to do to get this going? Is their other things that I can enambe so I monitor under my unraid server too? Thanks.

Link to comment

iStat has been working great for me and I really like it.

 

I do have one problem with the .conf file used in the package manager though.  The disks that I have set to monitor are not being picked up correctly on a reboot.  I am not quite sure why, but for whatever reason I only end up with /mnt/user as the only disk to be monitored.

 

Any insight is much appreciated!

Link to comment

I got it going. Basically I had to do the following

 

I don't see any benefit of istat.sh if you save a local edited copy of istat.conf and istall it over the default in /usr/local/etc after installation of the istat package itself. Just manually customize your personal /boot/config/istat.conf and omit the istat.sh at all.

Link to comment

I don't see you performing any of these steps when you reboot...

 

usr/sbin/useradd istat 2>/dev/null

/usr/sbin/groupadd istat 2>/dev/null

[ ! -d /var/run/istat/ ] && mkdir /var/run/istat

[ ! -d /var/run/istat/cache/ ] && mkdir /var/run/istat/cache

/usr/bin/chown -R istat:istat /var/run/istat

are they not needed?

Link to comment

The relevant lines I see in my syslog after a restart are:

Apr 10 12:29:38 Tower S10-install_custom_packages[1527]: ./istat-0.5.6.tgz.auto_install: line 5: /boot: is a directory
Apr 10 12:29:38 Tower S10-install_custom_packages[1527]: istatd: no process killed
Apr 10 12:29:38 Tower S10-install_custom_packages[1527]: Installing package libxml2-2.6.31-i486-2... 
Apr 10 12:29:38 Tower S10-install_custom_packages[1527]: PACKAGE DESCRIPTION:
Apr 10 12:29:38 Tower S10-install_custom_packages[1527]: libxml2: libxml2 (XML parser library)
Apr 10 12:29:38 Tower S10-install_custom_packages[1527]: libxml2:
Apr 10 12:29:38 Tower S10-install_custom_packages[1527]: libxml2: Libxml2 is the XML C parser library and toolkit. XML itself is a
Apr 10 12:29:38 Tower S10-install_custom_packages[1527]: libxml2: metalanguage to design markup languages -- i.e. a text language where
Apr 10 12:29:38 Tower S10-install_custom_packages[1527]: libxml2: structures are added to the content using extra "markup" information
Apr 10 12:29:38 Tower S10-install_custom_packages[1527]: libxml2: enclosed between angle brackets. HTML is the most well-known markup
Apr 10 12:29:38 Tower S10-install_custom_packages[1527]: libxml2: language. Though the library is written in C, a variety of language
Apr 10 12:29:38 Tower S10-install_custom_packages[1527]: libxml2: bindings make it available in other environments.
Apr 10 12:29:38 Tower S10-install_custom_packages[1527]: libxml2:
Apr 10 12:29:38 Tower S10-install_custom_packages[1527]: Executing install script for libxml2-2.6.31-i486-2...
Apr 10 12:29:38 Tower S10-install_custom_packages[1527]: 
Apr 10 12:29:39 Tower S10-install_custom_packages[1527]: Installing package istat-0.5.6... 
Apr 10 12:29:39 Tower S10-install_custom_packages[1527]: PACKAGE DESCRIPTION:
Apr 10 12:29:39 Tower S10-install_custom_packages[1527]: 
Apr 10 12:29:49 Tower useradd[3620]: new user: name=istat, uid=1003, gid=100, home=/home/istat, shell=
Apr 10 12:29:49 Tower groupadd[3621]: new group: name=istat, gid=1003

 

This is with the default settings that were provided with the package manager istat.conf file.

Link to comment

So just remove the execution line for the 'istat.sh' script in my go file and that would be fine, as their is no need for it, correct? Thanks.

 

I got it going. Basically I had to do the following

 

I don't see any benefit of istat.sh if you save a local edited copy of istat.conf and istall it over the default in /usr/local/etc after installation of the istat package itself. Just manually customize your personal /boot/config/istat.conf and omit the istat.sh at all.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.