Author: wtpson
Date: 20-10-02 02:27
Hello,
I read the netsaint documentation and put as many things as possible into MySQL database. To do this, you have to make these steps
cd /usr/ports/net/netsaint/
make CONFIGURE_ARGS+='--with-mysql-xdata --with-mysql-lib=${LOCALBASE}/lib/mysql' all install
mysqladmin create netsaint
cat /usr/ports/net/netsaint/work/netsaint-0.0.7/contrib/database/ | mysql netsaint
mysql mysql
---- cut here -----
insert into user (host,user,password) values ('localhost','netsaint',password('your_password_here'));
insert into db values ('%','netsaint','netsaint','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
flush privileges;
\q
---- cut here -----
cd /usr/local/etc/netsaint/
edit following files:
resource.cfg to activate DB * DATA
nscgi.cfg to activate DB * DATA
nscgi.cfg to *CHANGE* command for checking netsaint alive (read below)
netsaint.cfg to comment (#) comment_file
Why you have to cahnge netsaint_check_command? Well, netsaint uses:
/usr/local/libexec/netsaint/check_netsaint /usr/local/var/netsaint/status.log 5 '/usr/local/bin/netsaint'
with default. When you activate all possible data with DB, there is no /usr/local/var/netsaint/status.log file, so you will receive error message, that possible netsaint is not running. And then, some command could not be run. So to make netsaint daemon satisfied, I change netsaint_check_command with value:
/usr/local/libexec/netsaint/check_procs -w 2 -c 2 -C '/usr/local/bin/netsaint'
And everything is OK.
What are advantages of using DB? Well, there are some:
* it is very, very easy to modify 2D or 3D status map (just ine update in hostexinfo table)
* you save disk sapce for some logs (status.log)
* it's much quicker to get some info from DB.
* after update in hostexinfo table there is no need to reload netsaint with new configuration.
Unfortunatelly in current release (0.0.7_2,1) there no possibilities to move hosts.cfg to database. but maybe in the future... Who knows...
I hope, that I missed nothing, so you could repeat this steps without any error.
Please feel fre to post me, if you have any problems
Greeting
Krzysztof Stryjek
|
|