Re: ntpng expired flows to MySQL
Simone Mainardi <[email protected]> Tue, 5 Nov 2019 13:17:43 +0100
| Newsgroups | gmane.linux.ntop.general |
|---|---|
| Message-ID | <[email protected]> |
--===============5898752862404172770== Content-Type: multipart/alternative; boundary="Apple-Mail=_1CF34AC4-DC63-4B47-95E0-F28277D4D9E1" --Apple-Mail=_1CF34AC4-DC63-4B47-95E0-F28277D4D9E1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi Christina, Sure. We can guide you to achieve this and then, if you want, you can = also send us a pull request for the inclusion of the change in the mail = dev branch. Basically, you should work on MySQLDB.cpp file. Specifically: - Extend MySQLDB::createDBSchema and add an ALERT TABLE statement which = modifies the current db structure and adds client and server mac = addresses. I would pay attention to the type for efficiency. Probably, = the best type to use is a VARBINARY(6) for mac addresses - Edit macro MYSQL_INSERT_FIELDS in ntop_defines.h and add the newly = added columns - Edit MySQLDB::flow2InsertValues, in the snprintf, to actually print = also flow mac addresses in the INSERT INTO query. Regards, Simone > On 4 Nov 2019, at 16:39, Christina Phillips <[email protected] = <mailto:[email protected]>> wrote: >=20 > I am aware that MAC addresses are not exported and that this was = discussed back in 2016. Can this be added independently when ntopng is = compiled? I am asking because I am trying to design a single board = discovery system that would use MySQLto capture discovered devices in a = new client=E2=80=99s network. > =20 > We are designing the unit to have significant disk space (500GB) > =20 > CHRISTINA PHILLIPS / Director, IT Security Practice > INDEPENDENT NETWORK CONSULTANTS > e: [email protected] <mailto:[email protected]> m: 703.626.0385 > http://incsecurity.wordpress.com <http://incsecurity.wordpress.com/> > Twitter: https://twitter.com/ITSecurityNinja = <https://twitter.com/ITSecurityNinja> > LinkedIn: www.linkedin.com/in/ChristinaPMBA = <http://www.linkedin.com/in/ChristinaPMBA> > =20 > =20 > _______________________________________________ > Ntop mailing list > [email protected] <mailto:[email protected]> > http://listgateway.unipi.it/mailman/listinfo/ntop = <http://listgateway.unipi.it/mailman/listinfo/ntop> --Apple-Mail=_1CF34AC4-DC63-4B47-95E0-F28277D4D9E1 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; = charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><meta= http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8" = class=3D""><div style=3D"word-wrap: break-word; -webkit-nbsp-mode: = space; line-break: after-white-space;" class=3D"">Hi Christina,<div = class=3D""><br class=3D""></div><div class=3D"">Sure. We can guide you = to achieve this and then, if you want, you can also send us a pull = request for the inclusion of the change in the mail dev = branch.</div><div class=3D""><br class=3D""></div><div = class=3D"">Basically, you should work on MySQLDB.cpp file. = Specifically:</div><div class=3D"">- Extend MySQLDB::createDBSchema and = add an ALERT TABLE statement which modifies the current db structure and = adds client and server mac addresses. I would pay attention to the type = for efficiency. Probably, the best type to use is a VARBINARY(6) for mac = addresses</div><div class=3D"">- Edit macro MYSQL_INSERT_FIELDS = in ntop_defines.h and add the newly added columns</div><div = class=3D"">- Edit MySQLDB::flow2InsertValues, in the snprintf, to = actually print also flow mac addresses in the INSERT INTO = query.</div><div class=3D""><div class=3D""><br class=3D""></div><div = class=3D"">Regards,</div><div class=3D"">Simone</div><div class=3D""><br = class=3D""><blockquote type=3D"cite" class=3D""><div class=3D"">On 4 Nov = 2019, at 16:39, Christina Phillips <<a = href=3D"mailto:[email protected]" class=3D"">[email protected]</a>> = wrote:</div><br class=3D"Apple-interchange-newline"><div class=3D""><div = class=3D"WordSection1" style=3D"page: WordSection1; caret-color: rgb(0, = 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: normal; letter-spacing: normal; = text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; = text-decoration: none;"><div style=3D"margin: 0in 0in 0.0001pt; = font-size: 11pt; font-family: Calibri, sans-serif;" class=3D"">I am = aware that MAC addresses are not exported and that this was discussed = back in 2016. Can this be added independently when ntopng is = compiled? I am asking because I am trying to design a single board = discovery system that would use MySQLto capture discovered devices in a = new client=E2=80=99s network.<o:p class=3D""></o:p></div><div = style=3D"margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: = Calibri, sans-serif;" class=3D""><o:p class=3D""> </o:p></div><div = style=3D"margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: = Calibri, sans-serif;" class=3D"">We are designing the unit to have = significant disk space (500GB)<o:p class=3D""></o:p></div><div = style=3D"margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: = Calibri, sans-serif;" class=3D""><o:p class=3D""> </o:p></div><div = style=3D"margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: = Calibri, sans-serif;" class=3D""><b class=3D""><span style=3D"font-size: = 8.5pt; font-family: "Trebuchet MS", sans-serif; color: rgb(0, = 112, 192); text-transform: uppercase; letter-spacing: 1.5pt;" = class=3D"">CHRISTINA PHILLIPS</span></b><span style=3D"font-size: 8.5pt; = font-family: "Trebuchet MS", sans-serif; color: rgb(0, 112, = 192);" class=3D""> </span><span style=3D"font-size: 8.5pt; = font-family: "Trebuchet MS", sans-serif; color: rgb(136, 136, = 136);" class=3D"">/ Director, IT Security = Practice</span><span style=3D"color: rgb(31, 73, 125);" class=3D""><o:p = class=3D""></o:p></span></div><div style=3D"margin: 0in 0in 0.0001pt; = font-size: 11pt; font-family: Calibri, sans-serif;" class=3D""><b = class=3D""><span style=3D"font-size: 8.5pt; font-family: "Trebuchet = MS", sans-serif; color: rgb(0, 112, 192); text-transform: = uppercase; letter-spacing: 1.5pt;" class=3D"">INDEPENDENT NETWORK = CONSULTANTS</span></b><span style=3D"font-size: 8.5pt; font-family: = "Trebuchet MS", sans-serif; color: rgb(136, 136, 136);" = class=3D""><br class=3D""><b class=3D"">e:</b></span><span = style=3D"font-size: 8.5pt; font-family: "Trebuchet MS", = sans-serif; color: rgb(178, 178, 178);" class=3D""> </span><span = style=3D"color: rgb(31, 73, 125);" class=3D""><a = href=3D"mailto:[email protected]" style=3D"color: rgb(149, 79, 114); = text-decoration: underline;" class=3D""><span style=3D"font-size: 8.5pt; = font-family: "Trebuchet MS", sans-serif; color: blue;" = class=3D"">[email protected]</span></a></span><span style=3D"font-size: = 8.5pt; font-family: "Trebuchet MS", sans-serif; color: = rgb(178, 178, 178);" class=3D""> </span><b class=3D""><span = style=3D"font-size: 8.5pt; font-family: "Trebuchet MS", = sans-serif; color: rgb(136, 136, 136);" class=3D"">m:</span></b><span = style=3D"font-size: 8.5pt; font-family: "Trebuchet MS", = sans-serif; color: rgb(178, 178, 178);" = class=3D""> 703.626.0385<o:p class=3D""></o:p></span></div><div= style=3D"margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: = Calibri, sans-serif;" class=3D""><span style=3D"font-size: 8.5pt; = font-family: "Trebuchet MS", sans-serif; color: rgb(178, 178, = 178);" class=3D""><a href=3D"http://incsecurity.wordpress.com/" = style=3D"color: rgb(149, 79, 114); text-decoration: underline;" = class=3D""><span style=3D"color: blue;" = class=3D"">http://incsecurity.wordpress.com</span></a><o:p = class=3D""></o:p></span></div><div style=3D"margin: 0in 0in 0.0001pt; = font-size: 11pt; font-family: Calibri, sans-serif;" class=3D""><span = style=3D"font-size: 8.5pt; font-family: "Trebuchet MS", = sans-serif; color: rgb(178, 178, 178);" class=3D"">Twitter:<span = class=3D"Apple-converted-space"> </span><a = href=3D"https://twitter.com/ITSecurityNinja" style=3D"color: rgb(149, = 79, 114); text-decoration: underline;" class=3D""><span style=3D"color: = blue;" class=3D"">https://twitter.com/ITSecurityNinja</span></a><o:p = class=3D""></o:p></span></div><div style=3D"margin: 0in 0in 0.0001pt; = font-size: 11pt; font-family: Calibri, sans-serif;" class=3D""><span = style=3D"font-size: 8.5pt; font-family: "Trebuchet MS", = sans-serif; color: rgb(178, 178, 178);" class=3D"">LinkedIn: <span = class=3D"Apple-converted-space"> </span></span><span = style=3D"font-size: 8.5pt; font-family: "Trebuchet MS", = sans-serif;" class=3D""><a = href=3D"http://www.linkedin.com/in/ChristinaPMBA" style=3D"color: = rgb(149, 79, 114); text-decoration: underline;" class=3D""><span = style=3D"color: blue;" = class=3D"">www.linkedin.com/in/ChristinaPMBA</span></a><o:p = class=3D""></o:p></span></div><div style=3D"margin: 0in 0in 0.0001pt; = font-size: 11pt; font-family: Calibri, sans-serif;" class=3D""><span = style=3D"font-size: 8.5pt; font-family: "Trebuchet MS", = sans-serif; color: rgb(178, 178, 178);" class=3D""><o:p = class=3D""> </o:p></span></div><div style=3D"margin: 0in 0in = 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" = class=3D""><o:p class=3D""> </o:p></div></div><span = style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: = 12px; font-style: normal; font-variant-caps: normal; font-weight: = normal; letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; text-decoration: none; float: none; = display: inline !important;" = class=3D"">_______________________________________________</span><br = style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: = 12px; font-style: normal; font-variant-caps: normal; font-weight: = normal; letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; text-decoration: none;" class=3D""><span = style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: = 12px; font-style: normal; font-variant-caps: normal; font-weight: = normal; letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; text-decoration: none; float: none; = display: inline !important;" class=3D"">Ntop mailing list</span><br = style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: = 12px; font-style: normal; font-variant-caps: normal; font-weight: = normal; letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; text-decoration: none;" class=3D""><a = href=3D"mailto:[email protected]" style=3D"color: rgb(149, 79, = 114); text-decoration: underline; font-family: Helvetica; font-size: = 12px; font-style: normal; font-variant-caps: normal; font-weight: = normal; letter-spacing: normal; orphans: auto; text-align: start; = text-indent: 0px; text-transform: none; white-space: normal; widows: = auto; word-spacing: 0px; -webkit-text-size-adjust: auto; = -webkit-text-stroke-width: 0px;" = class=3D"">[email protected]</a><br style=3D"caret-color: rgb(0, = 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: normal; letter-spacing: normal; = text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; = text-decoration: none;" class=3D""><a = href=3D"http://listgateway.unipi.it/mailman/listinfo/ntop" style=3D"color:= rgb(149, 79, 114); text-decoration: underline; font-family: Helvetica; = font-size: 12px; font-style: normal; font-variant-caps: normal; = font-weight: normal; letter-spacing: normal; orphans: auto; text-align: = start; text-indent: 0px; text-transform: none; white-space: normal; = widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; = -webkit-text-stroke-width: 0px;" = class=3D"">http://listgateway.unipi.it/mailman/listinfo/ntop</a></div></bl= ockquote></div><br class=3D""></div></div></body></html>= --Apple-Mail=_1CF34AC4-DC63-4B47-95E0-F28277D4D9E1-- --===============5898752862404172770== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Ntop mailing list [email protected] http://listgateway.unipi.it/mailman/listinfo/ntop --===============5898752862404172770==--