The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Newer Topic  |  Older Topic 
 hostexinfo in database
Author: wtpson 
Date:   20-10-02 02:27


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;
---- 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

Krzysztof Stryjek

Reply To This Message
 Re: hostexinfo in database
Author: wtpson 
Date:   16-05-03 10:02


Some time ago I've posted a PR to include Database support in netsaint and nagios ports. This PR was closed (support included) about 2-3 month ago. So now it is much easier to do it.

Best regards
Krzysztof Stryjek

Reply To This Message
 Forum List  |  Threaded View   Newer Topic  |  Older Topic 

 User Login
 User Name:
 Remember my login:
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum