Telegraf Workflow
These are the common functions that will be needed to get the app up and generating Telegraf configs.
Work Flow
Below is a workflow to go from post-install to running.
flowchart TD
D(Add/Update Telegraf Plugins) --> E(Add/Update Telegraf Plugin Groups with Dynamic Groups);
E --> F("Add/Update Telegraf Templates (Optional)");
F --> G(Create Telegraf Agent Groups);
G --> H("Run Add Agent to Agent Group Job (Optional)");
H --> I(Run Telegraf Nautobot Pipeline Job);
click D "#addupdate-telegraf-plugins"
click E "#addupdate-telegraf-config-groups-with-dynamic-groups"
click F "#addupdate-telegraf-templates-optional"
click G "#create-telegraf-agent-groups"
click H "#run-add-agent-to-agent-group-job-optional"
click I "#run-telegraf-nautobot-pipeline-job"
Configuration
Now that Nautobot has the Telegraf schemas, config groups, and plugins, we need to set them up for the environment.
Add/Update Telegraf Plugins
Most plugins should not need any additional configuration, but in some cases, ports may need to be setup. GNMI, Net Response, and Execd are the main plugins to worry about as the ports can vary depending on the company/environment.
- Go to the Telegraf Plugins list view.
- Filter based on the JSON schema.
- Select all the plugins to edit and click Edit Selected.
- Set the device name to the proper format. Example:
{{device}}:57777
- Click Apply.
Add/Update Telegraf Plugin Groups with Dynamic Groups
By default, no Dynamic Groups are added to Telegraf Plugin Groups on Import, this means you will need to select a Dynamic Group for each Telegraf Plugin Group.
- Go to the Telegraf Plugin Groups List View.
- Click Edit on one of the Plugin Groups.
- Set the Dynamic Group and click Update.
Add/Update Telegraf Templates (Optional)
Note
If you don't have a Telegraf Generated Configs
Repository or don't need any additional files created, this step is not necessary.
Some updates may be required depending on your environment to the Telegraf Templates.
These are Jinja2 templates that allow for additional information to be saved to a Git repository for Gitops type functionality. These templates can be things like Kubernetes kustomizations or Docker compose files.
There are 2 different template types:
- Agent Group - this is applied once for the agent group. An example would be the
kustomization.yaml
file. - Agent - this is applied per agent. This is useful for files that you need created for each individual agent.
Templates have 2 variables that can be used:
obj
- this is the agent_group.agent
- the individual agent this config is being created for.
Note
The agent
variable can only be used on Agent based templates.
Create Telegraf Agent Group
From the Netobs menu or the Telegraf Dashboard, click on the button to add a new Telegraf Agent Group page, fill out the form
Below is more detail on the fields.
Name | Description |
---|---|
Max devices per agent | Gives a banner message if more devices are assigned to any agent than requested. This will not stop or break anything, it is just to give a warning. |
One Device Per Agent | Select if you want an agent only polling one device. |
Agent Naming Pattern | Jinja2 template of how the agents should be named. |
Connection Type | Choose how you want Telegraf to talk to the devices either by DNS name or IP address. |
Connection Suffix | Domain name if using DNS for talking to the devices. |
There is also a portion of the form to set the Telegraf Agent configuration. This gets applied to each Telegraf agent.
Run
Run Add Agent to Agent Group Job (Optional)
Note
If you have selected One Device Per Agent
this step is not necessary.
- From the Telegraf Agent Group Detail page, click on the
Add Agents
by the agents table. - On the Job Submission page, select how many agents to add or to use the max agent value to have Nautobot Netobs calculate how many agents are needed.
- Once the job is done, you should see success and that the total number of agents has been added.
Run Telegraf Nautobot Pipeline Job
The Telegraf Nautobot Pipeline Job will assign devices to agents, generate the Telegraf configs, and (if a Git repository is assigned to the Telegraf Agent Group) write files to a Git repository.
- From the Telegraf Agent Group, click on the
Run Telegraf Nautobot Pipeline
button. - Update any options needed on the Job Submission page that may be needed. The most common change would be to
Reblance
the agent to device mapping. This is useful when a lot of devices have been added/removed. - Click on the Run Job Now button.
- Wait for the configs to Generate.
You can now view the Telegraf Configs.