In this guide we will use the sysmon component to introduce basic plugin development concepts in CycleServer. This component periodically runs a ‘ps’ command, stores the output in the data store and displays this data in a web-based interface.
First, check out the sysmon component from git, by running the following command:
git clone https://github.com/cyclecomputing/sysmon.git
Now, from the newly-creating ‘sysmon’ directory, run the following command:
This will build the component and run its unit tests. To deploy sysmon normally, you would copy the zip file in ‘sysmon/build/distributions’ to the ‘components’ directory of your CycleServer installation. However, in this case we are going to set CycleServer to load the component from source.
Log in to CycleServer as an administrator and click the ‘admin > Browse Data’ link in the upper right-hand corner of the screen. Next, select ‘ComponentSource’ from the list on the left. ComponentSource records each represent a component that is loaded. In the case of .zip file components, this record contains the entire binary. When loading components from source, the record will point to a location on disk where the expanded component is located.
Create a new ComponentSource record by clicking the ‘Create’ menu item on the table. Fill in the following attributes:
- Name – the name of the component. This should match the value in your component.cfg file. In
this case, the value should be ‘sysmon’.
- Directory – the full path of the directory that contains the component.cfg file. If you
checked out the sysmon component to ‘/home/myuser/sysmon’, this value would be
- Enabled – If unchecked, plugins in this component will not be loaded into CycleServer. Leave