Looks about right - I've thrown it up on SourceForge in the user contributed area.
You could also do your nightly reset in there - although remember you would have to have the password in the curl/wget/lynx command, so you would probably want to set up a separate user that only can run reset. -----Burton > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of > Michael Gale > Sent: Tuesday, February 24, 2004 7:07 PM > To: [EMAIL PROTECTED] > Subject: [Ntop] From ntop to mysql with php > > > Hello, > > I have a attached a php script which when run will connect > to a ntop running on > 127.0.0.1:3000, do a data dump and save the file using libcurl. > The file will > tried to be saved ./month-day-year-timestamp (02:24:04-1077635664). > > This is done for logging, then the file is "include"d in the php > script so the > php variables are accessible. > > It will then parse the data and try to insert it into a mysql db > called ntop. > The table name is ntop_daily with a user name and password of ntop. > > >From the file you can see all the fields that I save data on. > This was my first > real php script so you most likely could improve it. > > I called the script by using curl: > > cronjob: > > /usr/bin/curl -k -s -s --digest -u username:password > https://mis.domain.com/uploads/ntopget.php > > This way if you had multiple ntop servers you could pass it a IP > as a variable. > Also a up now button would be possible. Anyways I hope someone > could use this, I > find it handy to save stats based a day bases. > > -- > Michael Gale > Network Administrator > Utilitran Corporation > _______________________________________________ Ntop mailing list [EMAIL PROTECTED] http://listgateway.unipi.it/mailman/listinfo/ntop
