So, ya wanna learn how to write a driver for this here system, eh? You, sir, are in luck as documentation now exists! It's really fairly easy. Don't be intimidated. Step 1: Choose a directory and module name for your driver. The directory should be created under the "lib" directory CHIRP is installed in. (It really can be put anywhere as we'll see later, but keeping the drivers all in one place is a good idea!) The directory name should probably be the vendor name of the device. Cisco, Fore, 3Com, etc... There are currently three exceptions to this rule: None, Unknown, and Template. The module name should have something to do with the model of the device the driver will work for. So, if you are writing a driver for a Cisco Catalyst 5000, you may want to create the driectory "Cisco", and name your module "Cat5000.pm". Of course, you might be writing a driver that works for ALL of Cisco's Catalyst series in which case you might want to name your module "Catalyst.pm". Step 2: Create your directory if it doesn't already exist. For example, lib/Cisco. Step 3: Copy lib/Template/Template.pm into your directory and rename it to your newly chosen module name. For example, "Cat5000.pm". *** For the rest of these steps, I am assuming a directory name of ### Cisco, and a module name of Cat5000, Please take note of that. Step 4: Edit the package name for your module. The package name should reflect the directory and module name you have chosen: At the top of the file you will see: package CHIRP::Template::Template; Change this to, for example: package CHIRP::Cisco::Cat5000; Step 5: Write your driver. The driver produces a configuration by returning a hash that contains the entire configuration. The upper level routines (called by CHIRP.pm) take care of creating the output (and making it look nice), dealing with upper/lowercase issues, adding site specific configuration options, etc... The hash mirrors the configuration file that should be generated. This should be made clear by what is in the template module, have a look at it. A few things to note about the driver. The driver should never, under any circumstances, under penalty of death and dismemberment, or at least social outrage, generate configurations with the following: These definitions should be placed in the Defaults or SITE.cfg file. Target datadir rrd-poll-interval rrd-datafile ranges default-ranges Range * RRA * The configuration produced by the driver MUST include: OID * Datasource rrd-ds-type ds Target snmp-host snmp-community snmp-port snmp (%snmp-community%@%snmp-host%:%snmp-port%) inst It is also highly recommended that the driver include the following with the intent being to allow for easy sharing of driver files that should work on all systems regardless of what is previously defined in a Defaults file. Datasource view desc Graph legend units y-axis Target --default-- directory-desc Target display-name order short-desc A word of warning: be very careful about making sure the driver produces double-quotes (") where it should. With Perl, it's really easy to add them (and forget to add them). An example: $config->{"target"}->{"--default--"}->{"y-axis"} = "Things per second"; This will produce an invalid config file because the (") will be interpreted by Perl and not included in the value. This is how it should be: $config->{"target"}->{"--default--"}->{"y-axis"} = '"' . "Things per second" . '"'; Note: You could also do: $config->{"target"}->{"--default--"}->{"y-axis"} = '"Things per second"'; You need to be aware that in this case if your string contains a Perl variable that you intend to have expanded, it will not be expanded. For example: my($MyValue) = "My Text String"; $config->{"target"}->{"--default--"}->{"MyTag"} = '"$MyValue"'; When printed will appear as: target --default-- MyTag = $MyValue If you instead use: my($MyValue) = "My Text String"; $config->{"target"}->{"--default--"}->{"MyTag"} = '"' . "$MyValue" . '"'; It will be printed as: target --default-- MyTag = "My Text String" Note: As of CHIRP version 0.6, CHIRP will automatically quote values containing spaces that are not already quoted. Step 7: CHIRP determines which driver to use for a particular device by querying the device according to the contents of an ID configuration file. For a new driver to be registered, a section similar to the following will have to be added. Please note, this file should be administered by the site administrator, therefore, this file should not be updated via a patch or anything of that variety. Instead, the driver should include a file with appropriate commands to be entered into the site ID file. OID SysDescr .1.3.6.1.2.1.1.1.0 Device Cisco_Cat5000 Module = "lib::Cisco::Cat5000" Package = "CHIRP::Cisco::Cat5000" Vendor = "Cisco" Model = "Catalyst 5000" Match = "OID0" OID0 = "snmp://%snmp%/SysDescr=WS-C5000" Step 8: Contribute your driver to the community. Your driver should be incorporated into the next distribution of CHIRP. To have it incorporated send your driver to chirp@honermann.net. Also, posting your driver to the Cricket contrib area at http://www.gnac.com/techinfo/cricket_contrib/ is a good idea.