Pmacct - "Unknown key: interface" , "no such column: vlan_in"

I am trying to configure pmacct but after installation I get the following error.

WARN: [/etc/pmacct/pmacct.conf:9] Unknown key: interface. Ignored.

After reboot

obraz

and after command /etc/init.d/pmacct restart

obraz

The contents of the pmacct.conf file.

!
! Pmacctd configuration file for IPFire environment
!

syslog: daemon
daemonize: true
debug: false
promisc: true
interface: green0


!
! "plugin1" plugin configuration
!
plugins: memory[plugin1]

plugin_buffer_size[plugin1]: 102400
plugin_pipe_size[plugin1]: 10240000

imt_mem_pools_number: 256
imt_path[plugin1]: /var/spool/pmacct/plugin1.pipe

aggregate[plugin1]: src_host, src_port, src_mac, dst_host, dst_port, dst_mac, proto
aggregate_filter[plugin1]: ip

IPFire 2.27 (x86_64) - Core-Update 175

Best

as far as I can see, this not a key.

1 Like

I suspect we need some input from @jon but looking through the allowed config options for pmacct then
interface:
has not been an allowed option since pmacct was intrioduced here (and probable before that).

The only option I could find in the CONFIG-KEYS file was
pcap_interface:

That would suggest that the error message has always been there but @jon would need to comment on that.

The info for pcap_interface: says that if it is not defined then the default is take the interface supplied by the Operating System. Maybe IPFire automatically shows green0 as the first interface it supplies so the config file has worked in the past. Although that would mean that if someone put interface: blue0 then pmacct would likely still end up with green0.

1 Like

If that’s true, the text in the wiki needs to be changed.

Also the default pmacct.conf file that is provided.

That is why it needs @jon input as he developed this originally and will know where the interface: command came from.

1 Like

Thank you very much for your quick responses.

Below is a tip I found while looking for a solution to the problem

Hi @zabudskyi , ‘pcap_interface’ is an alias to ‘interface’ and was introduced in 1.7.1 - but you are using 1.7.0. If you prefer to use online / browseable documentation then refer to the 1.7.0 branch: GitHub - pmacct/pmacct at 1.7.0 . In short, change ‘pcap_interface’ to ‘interface’. Paolo

It seems that since version 1.7.1 it appears pcap_interface: instead of interface:


pmacctd-imt.conf.example v 1.7.0

!
! pmacctd configuration example
!
! Did you know CONFIG-KEYS contains the detailed list of all configuration keys
! supported by 'nfacctd' and 'pmacctd' ?
!
! debug: true 
interface: eth0
daemonize: true 
plugins: memory
aggregate: src_host,dst_host
imt_buckets: 65537
imt_mem_pools_size: 65536
! imt_mem_pools_number: 0

pmacctd-imt.conf.example v 1.7.1

!
! pmacctd configuration example
!
! Did you know CONFIG-KEYS contains the detailed list of all configuration keys
! supported by 'nfacctd' and 'pmacctd' ?
!
! debug: true 
pcap_interface: eth0
daemonize: true 
plugins: memory
aggregate: src_host,dst_host
imt_buckets: 65537
imt_mem_pools_size: 65536
! imt_mem_pools_number: 0

This is the commit that changed the key, this was done to support multiple interfaces.

1 Like

You can find in message 7 the link to the commit that introduced the KEY change, from the log it seems clear that this was done to introduce multiple interfaces. To me it looks like the pmacct.conf file provided should be updated, therefore I think a bug report is the way to move forward.

@bonnietwin do you agree?

After changing to pcap_interface: green0, the message does not appear.

obraz

The rest in @Jon’s hands :wink:
and the other Developers.

Best Regards

2 Likes

I reported the error, I hope correctly

https://bugzilla.ipfire.org/show_bug.cgi?id=13159

@tphz, based on my reading of the documentation, you might find the following information useful. If you want to monitor two different interfaces, you can specify this in your pmacct.conf:

pcap_interfaces_map: /etc/pmacct/interfaces.map

Then, you need to provide the interfaces.map file:

ifname=green0 ifindex=100 direction=in
ifname=blue0 ifindex=101 direction=in

In this configuration:

  • ifname refers to the name of the network interface.
  • ifindex (optional) provides an alternative way to identify the interface using an index number.
  • direction defines the direction of the traffic to be monitored, where in corresponds to inbound and out to outbound traffic. If direction is not specified, pmacct captures both inbound and outbound traffic by default.

Obviously, in this case you do not define pcap_interface which is used when you monitor a single interface.

1 Like

@tphz I hope you do not mind that I wrote in your bug report a summary of the discussion. I think this is better for the developers.

1 Like

Yes that looks the best way to go.

The change was made in 1.7.1 but the first version in IPFire was 1.7.6 so this has been incorrect since the start but as long as you want green0 it looks like it worked with the default interface value.

my errors are very different. I have no errors in the config file. But I do have lots of these errors:

Jun 13 22:45:01 ipfire pmacctd[4485]: INFO ( plugin3/sqlite3 ): *** Purging cache - START (PID: 4485) *** 
Jun 13 22:45:01 ipfire pmacctd[4485]: ERROR ( plugin3/sqlite3 ): no such column: vlan_in  
Jun 13 22:45:02 ipfire last message repeated 327 times
Jun 13 22:45:02 ipfire pmacctd[4485]: INFO ( plugin3/sqlite3 ): *** Purging cache - END (PID: 4485, QN: 0/328, ET: 1) *** 

And vlan_in is not a column I have or use.

Time to escalate to Erik @ummeegge !


EDIT:

[**root@ipfire** ~] # pmacct -V
pmacct IMT plugin client, pmacct 1.7.8-git (RELEASE)

EDIT2:

[root@ipfire ~] # cat /etc/pmacct/pmacct.conf
!
! Pmacctd configuration file for IPFire environment
!

!-----------------------------------  global  --------------------------------------------

syslog: daemon
daemonize: true
debug: false
promisc: true
interface: green0

imt_mem_pools_number: 256

!pcap_interfaces_map: /etc/pmacct/pcap_interfaces.map
!pcap_ifindex: map

plugins: memory[plugin1], sqlite3[plugin3]

It looks like you have a newer version than is released at the moment.

What happens if you run /etc/init.d/pmacct restart

1.7.8 is the release that came with CU 175

https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=094bbe083b20dfe8404ca3f27ae8f2b3d7821864

log snippet:

Jun 13 22:29:08 ipfire pakfire: DOWNLOAD FINISHED: /ipfire/pakfire2//2.27-x86_64/paks/pcengines-apu-firmware-4.19.0.1-16.ipfire
Jun 13 22:29:08 ipfire pakfire: DOWNLOAD STARTED: paks/pmacct-1.7.8-5.ipfire
Jun 13 22:29:08 ipfire pakfire: DOWNLOAD INFO: Host: mirror.vtti.vt.edu (HTTPS) - File: /ipfire/pakfire2//2.27-x86_64/paks/pmacct-1.7.8-5.ipfire
Jun 13 22:29:08 ipfire pakfire: DOWNLOAD INFO: /ipfire/pakfire2//2.27-x86_64/paks/pmacct-1.7.8-5.ipfire has size of 532376 bytes
Jun 13 22:29:09 ipfire pakfire: DOWNLOAD INFO: HTTP-Status-Code: 200 - 200 OK
Jun 13 22:29:09 ipfire pakfire: DOWNLOAD INFO: File received. Start checking signature...
Jun 13 22:29:09 ipfire pakfire: DOWNLOAD INFO: Signature of pmacct-1.7.8-5.ipfire is fine.
Jun 13 22:29:09 ipfire pakfire: DOWNLOAD FINISHED: /ipfire/pakfire2//2.27-x86_64/paks/pmacct-1.7.8-5.ipfire
Jun 13 22:29:09 ipfire pakfire: DOWNLOAD STARTED: paks/python3-trio-0.22.0-3.ipfire


EDIT: Very odd!

With the reset I see:

[root@ipfire ~] # /etc/init.d/pmacct restart
Stopping the pmacctd daemon...    Not running.                                                                 [ WARN ]
Starting the pmacctd daemon...
WARN: [/etc/pmacct/pmacct.conf:11] Unknown key: interface. Ignored.                                            [  OK  ]
[root@ipfire ~]

and in the message log I see:

Jun 25 13:17:23 ipfire pmacctd[21939]: INFO ( default/core ): Start logging ... 
Jun 25 13:17:23 ipfire pmacctd[21940]: INFO ( default/core ): Promiscuous Mode Accounting Daemon, pmacctd 1.7.8-git (RELEASE) 
Jun 25 13:17:23 ipfire pmacctd[21940]: INFO ( default/core ):  '--prefix=/usr' '--sysconfdir=/etc/pmacct' '--enable-sqlite3' '--enable-l2' '--enable-jansson' 'CFLAGS=-O2 -pipe -Wall -fexceptions -fPIC -m64 -mtune=generic -fcf-protection -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -fstack-clash-protection' 'CXXFLAGS=-O2 -pipe -Wall -fexceptions -fPIC -m64 -mtune=generic -fcf-protection -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -fstack-clash-protection' '--enable-traffic-bins' '--enable-bgp-bins' '--enable-bmp-bins' '--enable-st-bins' 
Jun 25 13:17:23 ipfire pmacctd[21940]: INFO ( default/core ): Reading configuration file '/etc/pmacct/pmacct.conf'. 
Jun 25 13:17:23 ipfire pmacctd[21940]: WARN ( default/core ): Selecting a suitable devices. 
Jun 25 13:17:23 ipfire kernel: device red0 entered promiscuous mode
Jun 25 13:17:23 ipfire pmacctd[21940]: INFO ( default/core ): [red0,0] link type is: 1 
Jun 25 13:17:23 ipfire pmacctd[21944]: OK ( plugin1/memory ): waiting for data on: '/var/spool/pmacct/plugin1.pipe' 
Jun 25 13:17:23 ipfire pmacctd[21945]: INFO ( plugin3/sqlite3 ): cache entries=32771 base cache memory=12713224 bytes 

You are correct if course. It was the git bit that confused me.

Sorry for confusing things.

1 Like

This gets ride of the WARN: [/etc/pmacct/pmacct.conf:11] Unknown key: interface. Ignored. message for me!
:+1:

Nicely done all!

Is this saying that the default interface is actually taken to be red0 rather than green0?

1 Like

yes, it looks like what was mentioned above - it grabs the first available! Ugh!

1 Like