Contributed Code

This section is for contributed contributed code and tips. Share your code &  tips/tricks with others!

This is a 'drupal book', each submission is a sub-page within the book, and the pages are listed below. 

Click on "Add child page" to add a new item if you wish. You must be an authenticated user on the FreeNAC website to add pages or attachments. There is an "example contribution" that you can play around with to learn.

If you have problems, post them in the Support Forum.
Regards,

Sean

/contrib included in FreeNAC

There are several contributed scripts already included in /contrib of the FreeNAC code base, these are briefly described here.

  1. generate_dhcp* and generate_dns* are used to generate DNS and DHCP server configurations based on the FreeNAC DB. See the relevant Techguide pages for more details: ISC DHCP Configuration, Bind DNS Configuration.
  2. migration* directories contai scripts for migration from one version of FreeNAC to another. config2db is a script for migrating v2.2 to v3 configurations files.
  3. vm_mac_ip.pl: query all running Virtual Machines on Vmware VirtualCentre, and then update their relevant records in FreeNAC, or insert new records. This allows FreeNAC to have a more complete inventory of devices on the network.
  4. vmpsd.1.3.sources: Source files used to compile the OpenVMPS component.
  5. proctst.pl is a tool for detecting when daemons die and restarting them.
  6. nacdemo_db.tgz and opennac_db.tar.gz contain a demo FreeNAC database, and an empty database for new installations.
  7. package_files contains the files needed for generating the Ubuntu package.
  8. The samba, freeradius, etc, etc_php5_cli, logrotate.d, kerberos directories contain sample configuration files.
  9. import_systems_csv1 is a sample for importing systems (example sample_csv1.txt) from a comma seperated value list of systems into the FreeNAC database.
  10. usr/local/bin/ contains two scripts filewatcher and mytop that may be useful for detecting file changes and monitoring mysql activity respectively.
  11. report_vlan_changes.php is a small script that will inform of any changes in vlan assignments on systems in the last 24 hours and also informs if a system has been placed during the last hour in a different vlan than the one that is assigned to it.