@Sebastian-Roth, @Wayne-Workman, @george1421 I agree.
I think the GUID generation can be done relatively simply. We may already have a GUID generated at install time. (FOG_UUID in FOG Settings I think.) Though I don’t know how generalized it is, and it’s more a random ID, not an actual UUID (in UUID Standard)
So my thoughts:
Keep this “polling/analytics” separate from the main fog code base (Maybe under utils?)
Ask, on next update/install, if the admin would like to send analytics data to fog, and potentially what to send?
Store this section to it’s own configuration file.
So the asking requests something like:
Would you like to send analytic data for FOG? (y/N)
We would like to collect the information once a week, on Sunday’s at 03:00:00. (This allows us to delete entries older than a week.)
The information we would like to collect are:
- Randomly Generated UUID -> This allows us to track the information anonymously, but also not continually add the request to the queue, data is inserted once, then updated as needed.
- FOG Version -> This will allow us to track what versions of FOG are currently in use.
- OS -> This tells us what type of OS you are using to host the fog server.
- OS Version -> This tells us what version of OS you are using to host the fog server
- Timestamp -> Just the date and time this was sent.
We allow the user to select what they’re comfortable sending. I think this is just a better method overall.
The utility should simply create a simple shell script to send the data the user would like in real time. To collect the FOG Version, should should be able to do a lookup of the /var/www/fog/lib/fog/system.class.php and look up FOG_VERSION in the file.
OS and OS Version should look at lsb_release -a if the command exists, or look at /etc/os-release, or fallback as needed. Finally, the utility would then create the crontab to perform the task regularly.
Getting UUID =
echo $(cat /proc/sys/kernel/random/uuid)
We call the configuration file something like
The script would be called something like
Crontab would look like:
0 3 * * 0 /usr/bin/bash /opt/foganalytics/foganalytics >/dev/null 2&>1
Does this all make sense and sound doable?