Applies To
- Zenoss 4.x
- Zenoss 3.x
- Zenoss 2.x
Summary
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 filesystems. After a device is modeled, performance monitoring daemons can use the modelling information to determine what to monitor, such as which filesystems to monitor or exclude from monitoring and how to monitor, for example using SNMP index.
Note: The ZenVMware zenpack is a special case that uses the zenvmwaremodeler daemon, and is not discussed here).
The zenmodeler daemon chooses the modeler plugins (these are called collector plugins in the GUI according to the zCollectorPlugins Z-property prior to version 3.x). The daemon then runs the plugins against the device to gather the 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 when the zenmodeler daemon starts. Because modeling can be processor / disk / resource intensive for both devices as well as the Zenoss server, manually scheduling the modeling process can be helpful in managing resources.
Procedures
The following procedures describe how to configure the modelling frequency for various Zenoss versions. Follow the instructions for your Zenoss version.
For Zenoss version 4.x
Perform the following to configure the modelling frequency using crontab:
- Stop the zenmodeler daemon on all collectors:
- From the command line:
Run the following command as the zenoss user:
$ zenmodeler stop - From the Zenoss UI:
- Navigate to Advanced > Daemons on the left hand navigation bar.
- Click the Stop button for the zenmodeler daemon.
- From the command line:
- Prevent zenmodeller from running when Zenoss starts up. Remove zenmodeler from the files that control zenmodeler startup:
- Edit the $ZENHOME/etc/daemons.txt file. Also the /$ZENHOME/etc/collectordaemons.txt:, if you are using it on the collectors.
- Locate and delete the zenmodeler line.
- Save and exit the file(s).
- Update the collectors to pick up the change. In the Zenoss UI:
- Navigate Advanced > Collectors.
- Select the remote collectors you want update from the right hand pane.
- Select the menu item Update Collector...
- Create a cron job on each collector for the zenoss user for zenmodeller. Add entries to crontab to schedule zenmodeler:
Modify a crontab in /etc to determine when zenmodeller should run. For example, edit /etc/cron.daily/zenoss to add the job:
# Remodel Zenoss devices on this collector.
0 0 * * * bash -lc '/opt/zenoss/bin/*_zenmodeler run --daemon --now'
Note: Use the "*_ " string if you have multiple collectors. Each collector has a collector1_zenmodeler collector2_zenmodeler. Remove the " *_" string if you have a single collector on the master.
For Zenoss versions 2.3.x, 3.x
Perform the following to change the modelling frequency using cron:
- Stop the zenmodeler daemon.
To stop the currently-running zenmodeler daemon on each collector (you can only have one collector).
- From the command line:
Run the following command as the zenoss use:
$ zenmodeler stop - For version 3.x:
- Navigate to Advanced > Daemons on the left hand navigation bar.
- Click the Stop button for the zenmodeler daemon.
- For version 2.3-2.5.2:
- Navigating to Settings > Daemons tab.
- Click the Stop button for the zenmodeler daemon.
- From the command line:
- Stop ZenModeler from being automatically restarted in the future.
Remove the zenmodeler line from the $ZENHOME/etc/daemons.txt file so that it does not start automatically with the rest of Zenoss. - In the RM UI, go to Advanced -> Events -> Clear Heartbeats. This will stop you from receiving heartbeat failures for the zenmodeler daemon(s) that are now stopped.
- Add a cronjob to schedule when ZenModeler runs.
Add a cronjob for the zenoss user on each collector to schedule when you want the modeler to run.
You'll want cronjobs like the following on each collector. Modify a crontab in /etc to determine when you want it to run. For example, edit /etc/cron.daily/zenoss to add the job:
# Remodel Zenoss devices on this collector.
0 0 * * * bash -lc '/opt/zenoss/bin/*_zenmodeler run --daemon --now'
Note: Use the *_ if you have multiple collectors. Each collector has a collector1_zenmodeler collector2_zenmodeler. If you have a single collector on the master, you can remove the " *_" string.
We are using Zenoss 4.2.5.
- Step 2 details handling the daemons.txt file. It's unclear whether this is supposed to be on the localhost collector, or remote collectors. It is not present on our localhost hub. Creating this file results in daemons being started up twice. Meanwhile, editing this on the remote collectors results in them being overwritten when the collectors are Updated.
- Step 4 details the wrong way to go about editing cron - /etc/cron.daily/zenoss contains an actual script to clean up temporary files in the renderserver. This file is executed by a different cron. I believe the correct way to do this is by using 'crontab -e' as zenoss user.
There are several typoes in this article, along with several passages that are not clear as to which device we should be making these changes (i.e., if in a multi-collector environment, are we editing daemons.txt? Or is this just for localhost? Does localhost also rely upon collectordaemons.txt?)
This article is not helpful and only raises more questions than it answers.