SliTaz SliTaz Forum

You are not logged in.

#1 2016-02-20 16:40:58

kultex
Administrator
Registered: 2011-03-28
Posts: 1,175

iptraf + vnStat

1) trying iptraf, I found out, that it is not working as it should. No logs and it is also not possible to configure it. When I look here,

http://rpm.pbone.net/index.php3/stat/4/idpl/25392754/dir/other/com/iptraf-3.0.0-1.efw.i386.rpm.html

iptraf needs a config file and /var/log/iptraf

but when I try to create this files in SliTaz, I still get message, that iptraf is unable to creat the log files.

2) for logging monthley networktraffic, it would be cool to have vnStat and vnStati

http://humdi.net/vnstat/

https://www.howtoforge.com/tutorial/vnstat-network-monitoring-ubuntu/

Offline

#2 2016-02-23 19:47:04

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: iptraf + vnStat

Hi Thomas,

Please try my package [c]iptraf[/c] I builded independently (see attach). It is fork of the original [c]iptraf[/c].

And it needs package [c]libpanel[/c] (see attach too or http://cook.slitaz.org/cooker.cgi?pkg=libpanel ).

Package [c]vnstat[/c] is added: http://cook.slitaz.org/cooker.cgi?pkg=vnstat

It already contains [c]vnstati[/c], but you need to install package [c]libgd[/c] to produce images using [c]vnstati[/c].

Offline

#3 2016-02-25 14:37:17

kultex
Administrator
Registered: 2011-03-28
Posts: 1,175

Re: iptraf + vnStat

thx Aleksej - very quick, because I am on tour...

first iptraf:

1) logs are working in your version....

2) there is also no config file - so it is not possible to configure iptraf

the error here is :"Cannot create config file", when I turn on logging in Configure

3) the normal SliTaz version does not have this error: "Warning: unable to lock general interface statistics on"

second vnstat

1) vnstat -l       works as expected....

2) the daemon does not work -

root@slitaz:/home/tux2 /etc/init.d/vnstat start

bash: /etc/init.d/vnstat: No such file or directory

Offline

#4 2016-02-25 15:30:48

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: iptraf + vnStat

Hi Thomas,

there is also no config file - so it is not possible to configure iptraf

the error here is :"Cannot create config file", when I turn on logging in Configure

Sorry for silly question — how can I re-produce it? With which keys I should run iptraf?

My iptraf package has (empty) file [c]/var/run/iptraf/iptraf.cfg[/c] and there's a question... that I can solve with the [c]strace[/c] I think...

/etc/init.d/vnstat: No such file or directory

Yes, absent. It is not produced in the compiling time, and I should to write it by myself... I'll see other /etc/init.d/* files for example...

Offline

#5 2016-02-25 21:08:11

llev
Member
Registered: 2011-12-09
Posts: 568

Re: iptraf + vnStat

About vnstat daemon: if it's an ordinary daemon, can't you just [c]ln -s daemon vnstat[/c]?

Offline

#6 2016-02-26 19:47:05

kultex
Administrator
Registered: 2011-03-28
Posts: 1,175

Re: iptraf + vnStat

Hi Aleksej,

just in the terminal as root

# iptraf

then you go to "Configure"

go to "Logging" - turn it on (with Enter) and go to "Exit configuration"

then you get the error

then you go to "Detailed Interface statistics" - select the interface and you get the errors

Offline

#7 2016-02-26 19:55:34

kultex
Administrator
Registered: 2011-03-28
Posts: 1,175

Re: iptraf + vnStat

and here is the /etc/init.d/vnstat from Ubuntu

I cant attach - so just here

#! /bin/sh

### BEGIN INIT INFO

# Provides:          vnstat

# Required-Start:    $local_fs $remote_fs $network

# Required-Stop:     $local_fs $remote_fs $network

# Default-Start:     2 3 4 5

# Default-Stop:      0 1 6

# Short-Description: lightweight network traffic monitor

### END INIT INFO

PATH=/usr/sbin:/usr/bin:/sbin:/bin

DESC="vnStat daemon"

NAME=vnstatd

PIDFILE=/run/vnstat/vnstat.pid

DAEMON=/usr/sbin/$NAME

DAEMON_ARGS="-d --pidfile $PIDFILE"

SCRIPTNAME=/etc/init.d/vnstat

USER=vnstat

. /lib/lsb/init-functions

# Exit if the package is not installed

[ -x "$DAEMON" ] || exit 0

case "$1" in

    start)

        log_daemon_msg "Starting $DESC" "$NAME"

        if [ ! -d /run/vnstat ]; then

            mkdir /run/vnstat

        fi

        chown $USER:$USER /run/vnstat

        start-stop-daemon --start --quiet --oknodo --chuid $USER \

            --exec $DAEMON -- $DAEMON_ARGS

        log_end_msg $?

        ;;

    stop)

        log_daemon_msg "Stopping $DESC" "$NAME"

        start-stop-daemon --stop --quiet --oknodo --retry=TERM/15/KILL/5 --pidfile $PIDFILE \

            --name $NAME

        status=$?

        rm -f $PIDFILE

        log_end_msg $?

        ;;

    status)

        pidofproc -p $PIDFILE $DAEMON >/dev/null

        status=$?

        if [ $status -eq 0 ]; then

            log_success_msg "$DESC is running"

        else

            log_failure_msg "$DESC is not running"

        fi

        exit $status

        ;;

    reload|force-reload)

        log_daemon_msg "Reloading $DESC configuration..."

        start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME

        log_end_msg $?

        ;;

    restart)

        $0 stop

        sleep 1

        $0 start

        ;;

    *)

        echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}"

        exit 1

        ;;

esac

Offline

#8 2016-02-26 20:12:44

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: iptraf + vnStat

Hi Thomas,

Thank you very much for the details. Tomorrow I'll see what's wrong with the vnstat  configuration and will add daemon startup file (with some adapting for SliTaz).

Offline

#9 2016-02-27 15:29:38

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: iptraf + vnStat

Hi Thomas,

Sorry, I have only time to tell what I found, no package changes few more days:

Package missed important working folder, create it once manually now:

[c]# mkdir -p /var/run/iptraf[/c]
Configure → Logging → turn on → Exit configuration → no error

Detailed Interface statistics → select the interface → asks for log file every time (press Enter) → works and no error

________

Funny minute:

[c]# iptraf --help
Invalid option or missing parameter, use iptraf -h for help

# vnstatd -h
Unknown arg "-h". Use --help for help.[/c]

Offline

#10 2016-02-27 21:47:54

kultex
Administrator
Registered: 2011-03-28
Posts: 1,175

Re: iptraf + vnStat

thx Aleksej

iptraf works now as it should

iptraf-ng has the same error, but also needs

mkdir -p /var/log/iptraf-ng

Offline

#11 2016-03-01 15:28:46

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: iptraf + vnStat

Hi Thomas,

New versions are available:

http://cook.slitaz.org/cooker.cgi?pkg=iptraf

http://cook.slitaz.org/cooker.cgi?pkg=iptraf-ng

http://cook.slitaz.org/cooker.cgi?pkg=vnstat

Changes:

http://hg.slitaz.org/wok/rev/5f489761d0c4

http://hg.slitaz.org/wok/rev/8e7ad14f5f88

Please test when you can.

Note, vnstat daemon can start now automatically at a boot time to collect traffic values (need to add "vnstatd" to the RUN_DAEMONS string in the /etc/rcS.conf).

Offline

#12 2016-03-02 11:51:15

kultex
Administrator
Registered: 2011-03-28
Posts: 1,175

Re: iptraf + vnStat

thx Aleksej,

on my system - still my old iso - I get errors

Installing iptraf...cp: target '/var/run' is not a directory

                                                                     [ Failed ]

I will try it with the Live CD, when I am home....

Offline

#13 2016-03-03 11:28:21

kultex
Administrator
Registered: 2011-03-28
Posts: 1,175

Re: iptraf + vnStat

thanks a lot - evrything looks fine......

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.023 seconds, 7 queries executed - Memory usage: 1.56 MiB (Peak: 1.77 MiB) ]