Follow

How to Edit the zenmodeler File to Configure Model Scheduling in Zenoss 5.x

Applies To

  • Zenoss 5.x
  • Zenoss 6.x

Summary

This KB discusses the procedure to change or configure the modelling frequency for Zenoss 5.x. For information about changing the modelling frequency on previous Zenoss versions, see the KB titled: How to Change the Frequency of Modelling (Zenoss 4.x and below).

Modeling refers to discovering information on a device. Modeling information is gathered by the zenmodeler daemon. This information can include basic configuration such as hardware model, OS information, serial numbers, and software inventory. It can also include components such as network interfaces and file systems. After a device is modeled, performance monitoring daemons can use the modelling information to determine what to monitor, such as which file systems to monitor or exclude from monitoring and how to monitor, for example using SNMP index.

Note: The vSphere ZenPack is a special case that uses the zenvsphere daemon, and is not discussed here.

The zenmodeler daemon chooses the modeler plugins and runs them against the device to gather modeling information. The modeling information is then passed to zenhub to make changes to the ZODB database.
By default, modeling runs every 12 hours, starting from the time the zenmodeler daemon starts. Because modeling can be processor / disk / resource intensive for both devices as well as the Zenoss server, manually scheduling the start of the modeling process can be helpful in managing resources. For example, in an environment with 4 collectors and a modeling cycle interval of 12 hours, it would make sense to stagger modeling between those 4 collectors every 3 hours using the startat configuration directive. With such a configuration, the zenmodeler daemons on all of the collectors would start their initial run 3 hours apart and give each other time to run separately before starting a new cycle, rather than running all of them concurrently.

The zenmodeler daemon, as of Zenoss 5.x, includes it own cron-like initial-start scheduler that is defined by its configuration file. Zenoss recommends using this scheduling functionality instead of crontab because it is more straight forward and prevents potential issues that can result from invoking serviced to launch zenmodeler from within a crontab file.

Procedures

The following procedures describe how to configure the modelling frequency for Zenoss version 5.x. The configuration file can be edited from either the Control Center UI or the Zenoss Resource Manager.

Note: A minimum access of global zenmanager is required to edit the zenmodeler configuration file through the Zenoss Resource Manager.

From the Control Center UI

  1. From the Control Center UI, click Zenoss.resmgr
  2. Navigate to: Zenoss > Collector> localhost > localhost
  3. Find your collector. Scroll down to zenmodeler.
  4. Click on zenmodeler
  5. Scroll up to Configuration Files
  6. Locate the zenmodeler.conf file.
  7. Click Edit to display the editor dialog.
  8. Scroll down to the entry:
    #startat None
  9. Add an entry to the the zenmodeler.conf file. For example to start zenmodeler's first cycle at midnight,  create the following (five fields):
    startat 0 0 * * * 
    

    NOTE: The zenmodeler.conf configuration file uses the same format as crontab for its initial run; this does not set zenmodeler's cycle interval. See zenmodeler.conf File Format, below for additional information.

  10. Click Save to save and exit the editor dialog.
  11. Restart zenmodeler. Click Restart to write out the changes.
    Note: No other restart is required.

From the Zenoss Resource Manager UI

  1. Login to the Zenoss Resource Manager UI
  2. Click Advanced
  3. Click Control Center
  4. Scroll down to zenmodeler
  5. Change the display drop down to Configuration Files
  6. Edit the file within the zenmodeler.conf file pane:
    1. Scroll down to the entry:
      #startat None
    2. Add an entry to the zenmodeler.conf file. For example to run zenmodeler's first cycle at midnight, create the following (five fields):
      startat 0 0 * * *
              

      NOTE: The zenmodeler.conf file uses the same format as crontab for its initial run; this does not set zenmodeler's cycle interval. See zenmodeler.conf File Format, below for additional information.

  7. Click Save to save the changes. A yellow flair message in the top bar indicates the file is successfully changed.
  8. Restart zenmodeler, click Restart.

zenmodeler.conf File Format

The zenmodeler.conf file uses the same format as crontab.

Excerpt from the crontab(5) man page:

  The time and date fields are:
  field          allowed values
  -----          --------------
  minute         0-59
  hour           0-23
  day of month   1-31
  month          1-12 (or names, see below)
  day of week    0-7 (0 or 7 is Sunday, or use names)
  
A field may contain an asterisk (*), which always stands for "first-last".

Ranges of numbers are allowed.  
   Ranges are two numbers separated with a hyphen. 
   The specified range is inclusive.
 
Lists  are allowed.  
   A list is a set of numbers (or ranges) separated by commas.  
   Examples: "1,2,5,9", "0-4,8-12".

 

Was this article helpful?
2 out of 2 found this helpful

Comments

  • Avatar
    Josh Zenker

    As far as I can tell, these instructions don't explain how to change the modeling cycle interval. Is it the cycletime? For example, if I want my modeler to only run once a week at a specific time, can I set something like this?

    startat 0 21 * * 6
    cycletime 10080

  • Avatar
    Ryan Matte

    Hey Josh. The startat line is what controls when it runs when set. The cycletime is irrelevant once this is set. It will only run specifically at the times specified in startat. Treat it like you would any other cron / crontab job.

Powered by Zendesk