Title: Ntop Interface available Post by: mauroreggio on Friday 15 January 2016, 10:14:18 pm Hi all.
I have EFW Community 3.0 installed. I play many time with NTop and i need to make a little change: add in the interface list my red zone interface (eth1 and eth2). Now, i search a little and i find some usefull info: - on the EFW, the Ntop service starts from /etc/init.d/ntopng - in this start script i find that "NTOPNG_CONFIG="/etc/ntopng/ntopng.conf"" so /etc/ntopng/ntopng.conf is the Ntop configuration file - in /etc/ntopng/ntopng.conf i find, at the start, all the --interface entry: Code: root@XXXX:/etc/ntopng # [b]cat /etc/ntopng/ntopng.conf[/b] Now, is simple, i add 2 new line and all works ... no! Is NOT that!! All the time that i restart Ntop (service ntopng restart or restartntop) or reboot the system a new /etc/ntopng/ntopng.conf was "rebuilded". In /etc/ntopng/ folder there is another file: /etc/ntopng/ntopng.conf.tmpl and, IN MY OPINION, this is used for create a new configuration file every time the system is rebooted or the service is restarted. Now, the question: - is MY OPINION CORRECT? - in /etc/ntopng/ntopng.conf.tmpl i can find: Code: root@XXXX:/etc/ntopng # [b]cat ntopng.conf.tmpl[/b] $NTOP_INTERFACES ... Bingo!!! But ... where is declared and populated the $NTOP_INTERFACES variable? I can't be able to find it. Thanks all. Mauro. Title: Re: Ntop Interface available Post by: mrkroket on Saturday 16 January 2016, 02:48:51 am Your opinion is correct, all .conf.tmpl files rebuild .conf files. Once you know that it's easier to add tweaks to .conf files, and you don't break anything.
On linux, if you need to find a file with some contents on it you can use grep SEARCH_TERM * -R , and it's better used on one of these folders: /var/efw , /usr/lib, /usr/sbin, /etc. It also works on root folder (/), but gives you more warnings. The variable you look for is in: /usr/lib/python/site-packages/endian/restartscripts/ntop.py . In this script you'll see the "magic" for creating .conf files from .tmpl, and all templates used by ntop. Title: Re: Ntop Interface available Post by: mauroreggio on Monday 18 January 2016, 07:22:41 pm Your opinion is correct, all .conf.tmpl files rebuild .conf files. Once you know that it's easier to add tweaks to .conf files, and you don't break anything. On linux, if you need to find a file with some contents on it you can use grep SEARCH_TERM * -R , and it's better used on one of these folders: /var/efw , /usr/lib, /usr/sbin, /etc. It also works on root folder (/), but gives you more warnings. The variable you look for is in: /usr/lib/python/site-packages/endian/restartscripts/ntop.py . In this script you'll see the "magic" for creating .conf files from .tmpl, and all templates used by ntop. Thank you very much @mrkroket. It Seems that the $NTOP_INTERFACES variable is maked authomatically from the efw settings Code: for name, zone in getZones().iteritems(): In this case i'm not able to change it and insert other network interces ... or i don't know how. Any idea to point me in the right way? Mauro. Title: Re: Ntop Interface available Post by: mrkroket on Tuesday 19 January 2016, 03:01:39 am This is a Python script, if you know some programming you could add other interfaces (like uplinks) to the script.
But if you only need to add new interfaces and you want to make it fast and easy, just hardcode it on the template. It's far easier and you'll get the same. Obviously it will work only on your configuration and can't be shared. Title: Re: Ntop Interface available Post by: mauroreggio on Tuesday 19 January 2016, 03:21:50 am This is a Python script, if you know some programming you could add other interfaces (like uplinks) to the script. But if you only need to add new interfaces and you want to make it fast and easy, just hardcode it on the template. It's far easier and you'll get the same. Obviously it will work only on your configuration and can't be shared. Thankyou again @mrkroket I work on the /etc/ntopng/ntopng.conf.tmpl (before i make a copy of the original) This is my new Code: root@XXXX:/etc/ntopng # cat ntopng.conf.tmpl and this is the new /etc/ntopng/ntopng.conf after a restartntop Code: root@XXXX:/etc/ntopng # cat ntopng.conf And now i can switch from all my interface in the web frontend. Bye, Mauro. Title: Re: Ntop Interface available Post by: mrkroket on Tuesday 19 January 2016, 03:28:54 am Exactly that.
As you hardcoded eth1 and eth2 it won't work on other setups, but on yours it works fine. And it's way easier that changing the Python script. |