HotSaNIC

Install HotSaNIC

HotSaNIC is a very nice tool which combines all sorts of very important system graphs into a simple and easy to understand webpage. It allows the admin to take a quick glance at the graphs to see what may or may not be working with the system. With the new APPS graph it is also possible to watch as more processes are started which can be helpful in tracking down why the server load is increasing. For instance if you see a huge load spike but you see that the number of exim processes has gone up significantly at the same time you can start to investigate.

I built this guide on a cPanel server but it will work fine on an ensim box as well. I don't recall the plesk mailserver off the top of my head but changing that small part will make it work great fine plesk.

A HUGE THANKS TO FOGGY!! Much of this guide has been copied from the original posted here: http://forums.ev1servers.net/showthread.php?p=70160 . I have cleaned it up a little and updated it for the latest version of hotsanic.

 

 


First, we will need to install RRDtool. I am going to use an older version for now simply because it works. The new version 2 series requires some extra libs that are a pain to add in. When I get some time I will get it all figured out but for now this works. I believe the rrdtool page has info on how to fix the libs if you want to use the latest.


Some people have reported language problems to solve them go ahead and type "export LANG=en_US" before you start.

-----command-----
cd /usr/local/src/
wget http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/rrdtool-1.0.x/rrdtool-1.0.49.tar.gz
tar -zxf rrdtool-1.0.49.tar.gz
cd rrdtool*
./configure
make
make install
make site-perl-install
cd ..
rm -fr rrdtool*

-----command-----

Now we will install and configure HotSaNIC

-----command-----
cd /usr/local
wget http://easynews.dl.sourceforge.net/sourceforge/hotsanic/hotsanic-0.5.0-pre5.tgz
tar -zxf hotsanic-0.5.0-pre5.tgz
rm -rf hotsanic-0.5.0-pre5.tgz
cd HotSaNIC
./setup.pl

-----command-----

You will be asked a number of questions during the install script.

Module found: APCUSV Do you want to use this module?
Choose 'n'

Module found: APPS Do you want to use this module?
Choose 'y'

Do you want to show this module's graphs on the webpage? (Y/n)
Choose 'y'

Module found: BIND Do you want to use this module?
Choose 'n'

Module found: DISKIO Do you want to use this module?
Choose 'y'

Do you want to show this module's graphs on the webpage? (Y/n)
Choose 'y'

Module found: DNET Do you want to use this module?
Choose 'n'

Module found: MAILQ Do you want to use this module?
Choose 'n' (they only support postfix right now)

Module found: NETSTAT Do you want to use this module?
Choose 'n'

Module found: NETWORKS Do you want to use this module?
Choose 'n'

Module found: PART Do you want to use this module?
Choose 'y'

Do you want to show this module's graphs on the webpage? (Y/n)
Choose 'y'

Module found: SENSORS Do you want to use this module?
Choose 'n'

Module found: SHOUTCAST' Do you want to use this module?
Choose 'n'

Module found: SYSTEM Do you want to use this module?
Choose 'y'

Do you want to show this module's graphs on the webpage? (Y/n)
Choose 'y'

Module found: TRAFFIC Do you want to use this module?
Choose 'y'

Do you want to show this module's graphs on the webpage? (Y/n)
Choose 'y'

Module found: WORMS Do you want to use this module?
Choose 'n'

Found: eth0 - (y)es or (n)o
Choose 'y' (If you are prompted for any other interfaces starting with 'eth0' choose 'n')

Found: lo - (y)es or (n)o
Choose 'n'

0 /usr/local/cpanel/bin/rrdtoolinstall
1 /usr/local/cpanel/bin/rrdtoolcheck
2 /usr/local/cpanel/3rdparty/bin
by just pressing ´ENTER´, item "0" will be selected.
select item 0 ... 2? >

Select 0, we are going to change this below anyways.

 


You are now back at the command prompt. (If it asks you more questions, just accept the default answers.. we are using these settings below....)

Now we are going to start the manual configuration of hotsanic.

-----command-----
cd /usr/local/HotSaNIC/var/settings
pico -w main
-----command-----

press [ctrl -w] then type 'binpath' then press [enter]. Find and change this line.

BINPATH="not configured"

change to

BINPATH="/usr/local/rrdtool-1.0.49/bin"

press [ctrl -w] again then type 'webdir' then press [enter]. Find and change this line.

WEBDIR="not configured"

change to

WEBDIR="/home/username/public_html/stats/"
Note you are going to put this to someplace that is acessible to the internet. I would recommend setting it to a subdomain or a directory within a domain.

press [ctrl -w] again then type 'ctime' then press [enter]. Find and change this line.

CTIME="24"

change to

CTIME="4"

press [ctrl -w] again then type 'convertpath' then press [enter]. Find and change this line. If may already be changed, if so do not worry.

CONVERTPATH="not configured"

change to

CONVERTPATH="/usr/bin/convert"

Finally, to save and exit press [ctrl -x] Y then [enter]. At the prompt type.

pico mod_traffic

Find and change this line:

SWAPIO="no"

change to

SWAPIO="yes"

Again, to save and exit press [ctrl -x] Y then [enter]. At the prompt type.

pico -w mod_system

Go to the bottom and where you see all the IRQ= lines that are not commented out simply delete them.

Again, to save and exit press [ctrl -x] Y then [enter]. At the prompt type.


-----command-----
cat /proc/stat |grep disk_io
-----command-----

It is going to report something like this

disk_io: (8,0):(14081770,10200468,182341484,3881302,100409678) (8,1):(703,442,15844,261,3586)

Edit the disk_io config file

-----command-----
pico -w mod_diskio
-----command-----

At the bottom add:

DEV=8_0,sda
DEV=8_1,sda

If your system has something other then the (8,0) and (8,1) as listed above make sure to put that in the config above. Again, to save and exit press [ctrl -x] Y then [enter]. At the prompt type.

-----command-----
pico -w mod_apps
-----command-----

This mod is going to allow you to track how many of a given service is running. I would say that apache, mysql, and email are the most important. Note that exim is what cPanel uses, if you are using ensim replace it with sendmail. Add the following to the bottom:

APP=httpd,Apache
APP=mysqld,Mysql
APP=exim,Exim

Again, to save and exit press [ctrl -x] Y then [enter]. Note that below when you make the directory it needs to be what you put in the configuration file above. At the prompt type.


-----command-----
cd /usr/local/HotSaNIC
mkdir /home/username/public_html/stats
./rrdgraph start
./makeindex.pl
./diagrams.pl
./convert.pl
-----command-----

You now have HotSaNIC installed

To view HotSaNIC go to http://yourIPaddress/stats/

(it will take a few mins for the graphs to generate data.

Now, Lets set HotSaNIC up so it will start when you reboot your server.

-----command-----
pico /etc/rc.local
-----command-----

Add this line:

/usr/local/HotSaNIC/./rrdgraph start

Then [ctrl -x] Y then [enter] to save

If you are running a dual xeon with multiple CPUs the cpu graphs are going to go out longways. I will try to figure out how to fix that when I get time I was unable to at a quick glance. Thanks again to foggy for writing the original version. Please feel free to post any questions or comments as always and I will do the best to respond.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Qmail plesk mailserver

The email server of plesk is qmail ;)

regards,

JLChafardet

another hint for ya if you want it ;)

Starting qmail: [ OK ]
Starting Courier-IMAP server:
Starting imapd [ OK ]
Starting imap-ssl [ OK ]
Starting pop3 [ OK ]
Starting pop3-ssl [ OK ]

for some reason it doesnt generates the graphics.

It seems that my system has a problem with this as it doesnt generates the graphics.

regards,

hotsanic

Make sure the last commands you run all run without errors.

the last commands ran out

the last commands ran out without error, the error it gave me it was when i tryed to install RRDtools.

I will try to reinstall the RRDtools and reinstall hostsanic too.

regards,

JLChafardet

rddtools instalation

output down here:


Checking if your kit is complete...
Looks good
Writing Makefile for RRDs
cd perl-shared && make
make[3]: Entering directory `/usr/local/src/rrdtool-1.0.49/perl-shared'
cp RRDs.pm blib/lib/RRDs.pm
cp ntmake.pl blib/lib/ntmake.pl
/usr/bin/perl /usr/lib/perl5/5.8.5/ExtUtils/xsubpp -typemap /usr/lib/perl5/5.8.5/ExtUtils/typemap RRDs.xs > RRDs.xsc && mv RRDs.xsc RRDs.c
gcc -c -I.. -I../src -I../gd1.3 -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -DHAVE_CONFIG_H -O2 -g -pipe -m32 -march=i386 -mtune=pentium4 -DVERSION=\"1.000491\" -DXS_VERSION=\"1.000491\" -fPIC "-I/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE" -DPERLPATCHLEVEL=8 RRDs.c
cc1: invalid option `tune=pentium4'
make[3]: *** [RRDs.o] Error 1
make[3]: Leaving directory `/usr/local/src/rrdtool-1.0.49/perl-shared'
make[2]: *** [perl_shared] Error 2
make[2]: Leaving directory `/usr/local/src/rrdtool-1.0.49'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/rrdtool-1.0.49'
make: *** [all] Error 2
[root@hve01 rrdtool-1.0.49]#

are the last things i get when i try to configure rrdtools...

it is normal?

Some trouble

Seemed to get it going okay except for traffic. It appears to require SNMPD, which i have no idea how to setup. HoTSaNIC never used to need snmp did it? (Any method to get its nice traffic graphs happening without it? Or a simple snmpd setup guide? :))

snmpd

SNMPD is not required. I have installed this a few times with this guide and it has never needed it. You CAN use it but it is not required.

What distro/version are you running? When you say the traffic does not work does the graph not generate or is it just blank?

System, Part and Apps works

System, Part and Apps works fine. Diskio doesnt (because /proc/stat does not contain disk_io lines, it seems to be in /proc/diskstat instead), and by does not means there is a heading on the main page with no images being added to that column at all. There are no images generated by the scripts it seems.

Same with traffic, i have no idea why its not working if SNMP isnt required, though. There are no traffic images being generated. As far as i can tell from var/log/HoTSaNIC.log, traffic's module appears to run without error.

Hrm.Might have been because

Hrm.

Might have been because there was a missing "eth0" line in the traffic settings block. It appears that setup.pl didnt setup eth0 for me (maybe it didnt even ask the question about ethernet adaptors).

Edit: Thats what it was. The traffic settings file (where you change reverse in/out did not have an ETH0 line in it.

ps- I am running RHE3.

diskstat

That is really weird about the diskstat thing, I am going to have to look at a few other boxes because the other boxes were fine. What kernel are you running?

2.6.11-grsec following your

2.6.11-grsec following your tutorial using your config scripts.

[root@tango HotSaNIC]# cat /proc/stat
cpu 25916738 19573 2372242 292997571 2735478 114586 553504 0
cpu0 25916738 19573 2372242 292997571 2735478 114586 553504 0
intr 3564683424 3247085276 3 0 0 0 0 0 0 1 0 0 0 2 0 18474938 5 0 0 0 0 299123199 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
ctxt 161187305
btime 1110013676
processes 2624757
procs_running 1
procs_blocked 0
[root@tango HotSaNIC]#

distro

What distro are you running?

Updates

Challii on irc told me the latest rrdtool has the following deps:

i found that libpng was already installed, libart-devel installed from rpm was good enough for libart, and cgilib i found an rpm

http://dag.wieers.com/packages/cgilib/ << what i used for cgilib
and libart was installed from whm

I will update the guide when I get some time to reflect these deps.

Help! mod_ping No data?!

Following your very useful guide I have HotSaNIC installed. But it looks like it is failing to record the data.
I am getting the following error when I run the diagrams.pl step. I have left it running for a few hours and tried re-running, still no joy. (And the diagrams.pl is nowhere near 100 lines long!)
Anyone???
(obviously the X.X are numbers in the output, just didn't want you knowing the site name or it's gateway.. Paranoia! ;)

----- modules/ping -----
creating images for 192.168.X.X (xxxxxxxxx GW) ...
Use of uninitialized value in printf at ./diagrams.pl line 167 (#1)
(W uninitialized) An undefined value was used as if it were already
defined. It was interpreted as a "" or a 0, but maybe it was a mistake.
To suppress this warning assign a defined value to your variables.

dual xeon

Anyone have a fix for the dual xeon problem showing 4 seperate graphs?

a couple of problems

Ran into a couple of bumps while installing:

##########
Found: eth0 - (y)es or (n)o
Choose 'y' (If you are prompted for any other interfaces starting with 'eth0' choose 'n')
##########
I press Y but it doesn't show on the screen...had to press [enter] to continue

the following command does not return the 2 harddisks on my server:

#######
cat /proc/stat |grep disk_io
disk_io:
#######

Lastly, mysql graphs does not change, the graph shows a flat line near the top. This is what I see on top most graph (mysql - last hour):

--------
avg:17.00 process max:17 processes
--------

Stuck at 17 on mysql. o_0 really strange. I had hotsanic running for over 18 hours. No problems with the apache, exim graphs under APPS.

Hotsanic

Is that RHEL4? If so there are some problems with this version of hotsanic because they changed the /dev/ filesystem around.

It's CentOS 3.7 kernel 2.4x.

It's CentOS 3.7 kernel 2.4x. Ok, not really concerned about the disk I/O graphs but I want functional TRAFFIC graphs.

Found: eth0 - (y)es or (n)o
Choose 'y' (If you are prompted for any other interfaces starting with 'eth0' choose 'n')

I press 'y' but nothing happens, ran the setup.pl script many times, same thing :( do you know what's wrong? thanks.

Powered by Drupal - Theme created by Danger4k