Koozali.org: home of the SME Server

Obsolete Releases => SME 7.x Contribs => Topic started by: pssl on March 17, 2012, 03:06:06 PM

Title: VNSTAT not finding data
Post by: pssl on March 17, 2012, 03:06:06 PM
Hi.

I installed vnstat yesterday.  When I run it or load the frontend page it keeps saying "not enough data available yet" and the frontend shows zeros.  I'm don't know how long it should take for vnstat to gather data so I don't know if this is expected behavior. 

I checked the man pages but nothing is jumping out at me.  vnstat can see the interfaces (--iflist) and there is an eth0 database (I'm only interested in eth0) in /var/lib/vnstat/ directory.  There is no vnstat.conf in /etc/ so I assume vnstat is picking up the .conf file from somewhere else and I don't know where otherwise I'd take a look in there to see if there's something amiss.  The man page says that the vnstat.conf file will be used unless $HOME/.vnstatrc exists, which it doesn't...I looked in $HOME and did not see .vnstatrc.  So I have no idea where the .conf file is.

Update: I looked in the cron log and I see a bunch of the following:
Code: [Select]
Mar 17 10:40:01 cherubim crond[13920]: (nobody) CMD (/usr/sbin/vnstat.cron)
Is the "(nobody)" of any consequence?

Update 2: vnstat -l (live mode) shows traffic data.  So, vnstat is able to capture data on the interface.  It seems the problem may lie in vnstat's ability to retrieve traffic data from system files.  I thought that the problem may lie in the frontend but vnstat shows "not enough data" as well when you enter the vnstat command.

I've exhausted my limited knowledge and am hoping someone has suggestions as to how to determine if vnstat is installed and configured correctly and fix any problems.

Last Update (hopefully): I think I beat it to the ground.  As it turned out the "nobody" was significant.  I changed it to root in the /etc/cron.d/vnstat file, restarted crond and it works now.  I'm getting regular updates every 5 minutes.  May change that to 15 mins or even 30.
Title: Re: VNSTAT not finding data
Post by: Mntsnow on March 19, 2012, 06:40:04 AM
The following might help you out as I have posted what I had to do to get it working for me.  My posts are at the end of the following thread
http://forums.contribs.org/index.php/topic,45174.0.html
Title: Re: VNSTAT not finding data
Post by: pssl on March 19, 2012, 06:48:50 AM
mntsnow,

Thanks for the reply.  I'm sure I was in the process of figuring it out as you were writing your reply.  Again, thanks very much.

Title: Re: VNSTAT not finding data
Post by: Mntsnow on March 19, 2012, 06:55:28 AM
Glad you seem to have it going now  :-)  I try to help where I can even though I am a fairly new user of SME and still have tons to learn.

Enjoy!
Title: Re: VNSTAT not finding data
Post by: pssl on March 19, 2012, 02:04:13 PM
The following are things I had to do to get vnstat to work. I think it would be useful if the wiki had the info added.

After installation is complete I had to do the following.  The clue to me was the warning in red on the SME Server Manager page saying the the SME had to be configured and rebooted or it would be left in an unknown state.  I don't know if this happened to me because I did some wrong, but, if not, this seems to be an important missing step.

Code: [Select]
signal-event post-upgrade
signal-event reboot

Understanding that wikis are supposed to be for SME Server and that the vnstat wiki is supposed to be about getting vnstat installed in SME, it would be useful to have a section in the wiki for trouble shooting or something like that where the different things that people have had to do to get vnstat to work could be dropped in.  I and at least one other person (Mntsnow) had to do the following to get it to work.

1. Edit the vnstat cron file.
Code: [Select]
nano /etc/cron.d/vnstat2. Change the line
Code: [Select]
*/5 * * * * nobody /usr/sbin/vnstat.cronto
Code: [Select]
*/5 * * * * root /usr/sbin/vnstat.cron3. Restart crond.
Code: [Select]
service crond restart
Title: Re: VNSTAT not finding data
Post by: cactus on March 19, 2012, 08:41:10 PM
Understanding that wikis are supposed to be for SME Server and that the vnstat wiki is supposed to be about getting vnstat installed in SME, it would be useful to have a section in the wiki for trouble shooting or something like that where the different things that people have had to do to get vnstat to work could be dropped in.  I and at least one other person (Mntsnow) had to do the following to get it to work.
And therefore it is also a wiki as it is a collaborative effort. Request access and make the addition/changes.
Title: Re: VNSTAT not finding data
Post by: pssl on March 19, 2012, 10:44:46 PM
Cactus,

I've requested access.  However,  I'm not 100% sure where in the wiki I should put the "signal-event post-upgrade" and "signal-event reboot".  I'm thinking after "signal-event yum-modify".  I'd be happy to put this in if someone could confirm this.
Title: Re: VNSTAT not finding data
Post by: raem on March 19, 2012, 11:28:46 PM
pssl

Quote
...I'm not 100% sure where in the wiki I should put the "signal-event post-upgrade" and "signal-event reboot".  I'm thinking after "signal-event yum-modify".  I'd be happy to put this in if someone could confirm this.

As it is installation, then after the install steps.
I did it for you, plus added some other info from the forums.
Title: Re: VNSTAT not finding data
Post by: pssl on March 19, 2012, 11:56:06 PM
Ream,

That's great.  Thanks very much for your help.