Well at least someone has discovered it so it can be corrected.
As long as we keep moving forwards and keep making things better then we are improving things
Well at least someone has discovered it so it can be corrected.
As long as we keep moving forwards and keep making things better then we are improving things
No problem.
Thank you for adding the necessary information on bugzilla.
@jon if you have the opportunity, would be nice to test the multi interface settings. If you or @tphz can test the configuration in message 11 I could add it to the wiki.
That sounds good!
I am still testing the pmacct and the sql db. I have old data (before the CU 175 update), but I am not seeing new data. And that may be timing more than anything else (it only updates every x minutes). So I am waiting for a few writesâŚ
I still see the same error as above. And the db doesnât appear to be updating. So I am going to hold for a little while.
Jun 25 13:45:01 ipfire pmacctd[24294]: INFO ( plugin3/sqlite3 ): *** Purging cache - START (PID: 24294) ***
Jun 25 13:45:01 ipfire pmacctd[24294]: ERROR ( plugin3/sqlite3 ): no such column: vlan_in
Jun 25 13:45:01 ipfire pmacctd[24294]: INFO ( plugin3/sqlite3 ): *** Purging cache - END (PID: 24294, QN: 0/226, ET: 0) ***
[root@ipfire ~] #
EDIT:
may be related to pmacct issues knownâŚ
I would remove âmayâ from your statement. This looks like the same bug you are observing. This is likely due to the fact that the column vlan_in does not exist or it is misspelled in the table acct
, which triggers the error.
I wonder if the information in the following link will be helpful
edit
...
Aggregation primitive => SQL table field
...
...
* in_vlan => vlan_in (INT(4) NOT NULL DEFAULT 0)
...
edit2
NOTE: mind to specify EVERYTIME which SQL table version you
intend to adhere to by using the following config directives:
* sql_table_version: [ 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 ]
* sql_table_type: [ bgp ]
NOTE: specifying a non-documented SQL table profile will result
in an non-determined behaviour. Unless this will create crashes
to the application, such situations will not be supported.
In the log of the last release, there is this bit:
Introduced support for in/out VLAN support for sfacctd. To be
savy, âin_vlanâ and âvlanâ were muxed onto the same primitive
depending on the daemon being used. Thanks to Jim Westfall
( @jwestfall69 ) for this contribution.
The developer likely introduced a bug there.
@jon maybe a downgrade until the bug is fixed is the best option.
Thank you!
And sql_table_version
- this one I have.
and sql_table_type
- this one I am missing.
FYI - I think the issue is related to an error in one of the pmacct source files. I entered a bug in their issues area.
verify typos or errors at the config file: here some help from GPT:
despite coloms are optional copy paste this. It might be correct without Tabs spaces or other typos:
! 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
Test1
Contents of pmacct.conf
file
!
! Pmacctd configuration file for IPFire environment
!
syslog: daemon
daemonize: true
debug: false
promisc: true
!pcap_interface: green0
pcap_interfaces_map: /etc/pmacct/interfaces.map
!
! "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
Contents of interfaces.map
file
ifname=green0 ifindex=100 direction=in
ifname=blue0 ifindex=101 direction=in
pmacct IMT plugin client, pmacct 1.7.8-git (RELEASE)
[root@ipfire175t ~]# /etc/init.d/pmacct restart
Stopping the pmacctd daemon... [ OK ]
Starting the pmacctd daemon... [ OK ]
[root@ipfire175t ~]#
[root@ipfire175t ~]# pmacct -p /var/spool/pmacct/plugin1.pipe -s
SRC_MAC DST_MAC SRC_IP DST_IP SRC_PORT DST_PORT PROTOCOL PACKETS BYTES
0a:00:27:00:00:1c ff:ff:ff:ff:ff:ff 192.168.233.254 192.168.233.255 137 137 udp 3 234
0a:00:27:00:00:1c ff:ff:ff:ff:ff:ff 192.168.233.254 192.168.233.255 138 138 udp 1 229
0a:00:27:00:00:0f ff:ff:ff:ff:ff:ff 192.168.232.254 192.168.232.255 137 137 udp 3 234
0a:00:27:00:00:0f 08:00:27:34:cb:83 192.168.232.254 192.168.232.1 19334 222 tcp 324 25200
0a:00:27:00:00:1c 01:00:5e:7f:ff:fa 192.168.233.254 239.255.255.250 59288 3702 udp 49 33516
0a:00:27:00:00:0f 08:00:27:34:cb:83 192.168.232.254 192.168.232.1 19939 444 tcp 211 60101
0a:00:27:00:00:0f 08:00:27:34:cb:83 192.168.232.254 192.168.232.1 20040 444 tcp 91 25847
0a:00:27:00:00:0f 08:00:27:34:cb:83 192.168.232.254 192.168.232.1 19849 444 tcp 150 43059
0a:00:27:00:00:0f 01:00:5e:7f:ff:fa 192.168.232.254 239.255.255.250 59288 3702 udp 49 33516
0a:00:27:00:00:0f ff:ff:ff:ff:ff:ff 192.168.232.254 192.168.232.255 138 138 udp 1 229
@iptom (or anyone else),
Do you see the vlan-in
error in your messages log?
ipfire pmacctd[24294]: ERROR ( plugin3/sqlite3 ): no such column: vlan_in
Jon
I have not yet configured pmacct + sqlite.
I am in the process of doing it.
After the basic configuration described in the link below
https://wiki.ipfire.org/addons/pmacct/pmacct_sqlite3
grep "vlan_in" /var/log/messages
Jun 26 00:30:01 ipfire175t pmacctd[4637]: ERROR ( plugin2/sqlite3 ): no such column: vlan_in
Jun 26 00:45:01 ipfire175t pmacctd[9679]: ERROR ( plugin2/sqlite3 ): no such column: vlan_in
I did some test/experiment
I created a new file
/usr/share/pmacct/sql/pmacct-create-table_v1_fix.sqlite3
with the content
DROP TABLE IF EXISTS acct;
CREATE TABLE acct (
mac_src CHAR(17) NOT NULL DEFAULT '0:0:0:0:0:0',
mac_dst CHAR(17) NOT NULL DEFAULT '0:0:0:0:0:0',
ip_src CHAR(45) NOT NULL DEFAULT '0.0.0.0',
ip_dst CHAR(45) NOT NULL DEFAULT '0.0.0.0',
src_port INT(4) NOT NULL DEFAULT 0,
dst_port INT(4) NOT NULL DEFAULT 0,
ip_proto CHAR(6) NOT NULL DEFAULT 0,
packets INT NOT NULL,
bytes BIGINT NOT NULL,
stamp_inserted DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
stamp_updated DATETIME,
vlan_in INT(4) NOT NULL DEFAULT 0,
PRIMARY KEY (mac_src, mac_dst, ip_src, ip_dst, src_port, dst_port, ip_proto, stamp_inserted)
);
with the added line
vlan_in INT(4) NOT NULL DEFAULT 0,
then command
sqlite3 /var/spool/pmacct/pmacct_sqlitev1_fix.db < /usr/share/pmacct/sql/pmacct-create-table_v1_fix.sqlite3
next I edited the file
/etc/pmacct/pmacct.conf
!
! "plugin2" plugin configuration
!
plugins: sqlite3[plugin2]
sql_db[plugin2]: /var/spool/pmacct/pmacct_sqlitev1_fix.db
sql_table_version[plugin2]: 1
sql_history[plugin2]: 60m
sql_refresh_time[plugin2]: 15
sql_history_roundoff[plugin2]: m
aggregate[plugin2]: src_host, src_port, src_mac, dst_host, dst_port, dst_mac, proto
aggregate_filter[plugin2]: ip
notice:
sql_refresh_time[plugin2]: 15
for test only
[root@ipfire175t ~]# sqlite3 /var/spool/pmacct/pmacct_sqlitev1_fix.db
SQLite version 3.41.2 2023-03-22 11:56:21
Enter ".help" for usage hints.
sqlite> .mode columns
sqlite> .headers ON
sqlite> select * from acct LIMIT 10;
mac_src mac_dst ip_src ip_dst src_port dst_port ip_proto packets bytes stamp_inserted stamp_updated vlan_in
----------------- ----------------- --------------- ------------- -------- -------- -------- ------- ----- ------------------- ------------------- -------
0a:00:27:00:00:0f 08:00:27:34:cb:83 192.168.232.254 192.168.232.1 19334 222 tcp 421 30540 2023-06-26 01:00:00 2023-06-26 01:16:01 0
0a:00:27:00:00:0f 08:00:27:34:cb:83 192.168.232.254 192.168.232.1 23177 444 tcp 84 23688 2023-06-26 01:00:00 2023-06-26 01:15:01 0
0a:00:27:00:00:0f 08:00:27:34:cb:83 192.168.232.254 192.168.232.1 23266 444 tcp 75 21151 2023-06-26 01:00:00 2023-06-26 01:16:01 0
sqlite> .quit
edit
New vlan_in
errors in messages log did not appear
Hi all,
@jon for a fast one according to the âUnknown key: interfaceâ, in 1.7.6 (old Pmacct version on IPFire which accepted âinterfaceâ), âinterface:â has been marked in the source code as âLegacy Keyâ â https://github.com/pmacct/pmacct/blob/1.7.6/src/cfg.c#L73 whereby in 1.7.8 it disappeared completely â https://github.com/pmacct/pmacct/blob/1.7.8/src/cfg.c that´s why the key parsing â https://github.com/pmacct/pmacct/blob/master/src/cfg.c#L728 delivers this warning but also grabs only the first listed interface (green0 in that case).
If you search through the âinterfaceâ entries in cfg.c, only âpcap_interfaceâ appears for me as a reliable substitution for the old âinterface:â line in pmacct.conf but also as a usable key for a basic IPFire configuration since there is no collective (a configuration for all) support for Nfacctd, Telemetry, Sfacctd, BGP nor BMP and even if for some, the configuration will be much more extensive.
Short conclusion for a fast overview: âinterface:â should be replaced by âpcap_interface:â where you can use green, blue, red and orange (only one of them) and for multiple interfaces the âinterfaces.mapâ needs to be (as before) integrated.
Fast tests:
According to your âvlan_inâ problem, i think a solution is to modify the SQL template like @tphz â Pmacct - "Unknown key: interface" , "no such column: vlan_in" - #27 by tphz did it.
IMHO the Pmacct communication according to fundamental (configuration keys) update changes is worthy of improvement.
For the first. Best,
Erik
@ummeegge If it is possible, could you check whether the content of message 11 can be added to the wiki documentation?
Hello @cfusco,
you statements are correct according to interfaces.map even the âdirectionâ key might need also some further explanation since it is also possible to set two directions âinâ and âoutâ for the same interface or even to leave it blank. There has been some changes according to this â pcap_interfaces_map in pmacctd doesn't work with multiple items on same interface ¡ Issue #531 ¡ pmacct/pmacct ¡ GitHub but i haven´t checked them. Also the âpretag.mapâ â https://github.com/pmacct/pmacct/blob/master/examples/pretag.map.example might be interesting in this topic ?!
The last paragraph (pcap_interface:) from your statement should not be in the wiki (may until an update changes this) but be changed in the configuration file with another IPFire update in my opinion.
Best,
Erik
Keep in mind adding the column to a newly created database is fairly easy. But adding to an existing database may not be. I think the sqlite command is alter table
.
Time to read up adding a column to an existing database!
forgot to comment on this: It seems pmacct change something and the alias is gone. This is probably something to be raised in the GitHub pmacct âIssuesâ section.