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.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]
Article Feedback - NetSaint - a network monitor
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Previous Message  |  Next Message 
 hostexinfo in database
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

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

 Topics Author  Date
 hostexinfo in database   new
wtpson 20-10-02 02:27 
 Re: hostexinfo in database   new
wtpson 16-05-03 10:02 


 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Password:
 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

phorum.org