Configure a Rule Using Server Monitoring Sensor
In the following example, you can use server monitoring sensor to collect disk read data from servers. You can configure fields for total disk read size, time taken to perform the reads, and name of the device that has the disk (key field). You can also calculate rate of disk read and configure a trigger alert when the total disk read exceeds a preset threshold.
- Click Configuration > Rules .
- On the Rules page, click + Add Rule.
- Enter topic name as server.monitoring and set the rule name
after the slash ('/'). In this example, rule name can be check-disk-read.
The rule name in the top row of the rule page follows the topic/rule name format. The default topic name is ‘external’ when you add a new rule.
- Add a description and synopsis for your rule.
- Click + Add Sensor and enter a name for the sensor. For example, disk.
- Select Server Monitoring as sensor type.
- Enter sensor path as /node/disk.
If you add a / at the end of the path, you get sensor paths for disk reads, writes, and written records.
- Enter a Frequency (in seconds) for the sensor. For example, 30s.
The minimum usable sensor frequency is 15 seconds. It takes at least 15 seconds before you see data from the ingest.
- Go to Fields tab and click + Add Field and enter the Field
Name as device-name.
This field collects the name of the device containing the disk that generates read data.
- Select Field Type as string.
- Enable Add to Rule Key.
- Select Ingest Type (Field Source) as Sensor.
- Select the name of the sensor in the Sensor field. In this example, select disk.
- Type Device in the Path field.
- Go to Fields tab and click + Add Field and enter the Field
Name as disk-read-total.
This field collects the total size of disk reads in bytes.
- Select Field Type as float and Ingest Type (Field Source) as Sensor.
- Select the name of the sensor for the Sensor field. In this example, select disk.
- Select Path as /node/disk/read/bytes/total
- Click + Add Field and enter the Field Name as
disk-read-rate.
This field calculates the rate of change using the field value in disk-read-total.
- Select Field Type as float and Ingest Type (Field Source) as Formula.
- In Formula, select Rate of Change.
- In Field, select the field name disk-read-total.
- Click + Add Field and enter the Field Name as
read-threshold.
This field contains a constant value for disk read threshold.
- Select Field Type as float and Ingest Type (Field Source) as Constant.
- In Constant Value, enter a threshold value for disk reads. For example, 5.
- Go to Triggers tab and click +Add Trigger.
- Enter a name for the trigger such as read-trigger.
- Enter a Frequency value. For example, 2o (2 offset).
If you set frequency as 2o or 2 offset, it multiplies the static frequency you set for sensor frequency by 2.
- Click +Add Term and enter a term name. For example, high-disk-usage.
- In the When statement, select left operand as disk-read-total field, right operand as read-threshold field, and the operator as Increase At Least by Value.
- In the Then statement, set red as the color and enter Message as high disk read value.
- Do one of the following:
- Click Save to save the rule configuration. Paragon Automation does not deploy the rule configuration.
- Click Save and Deploy to deploy the configuration in Paragon Automation Platform.
To collect data on metrics, you must add the rule to a Playbook. Then, apply a Playbook instance to the device or the network groups.
When you start collecting server metrics, you can see the logs by providing the pod IDs for the ingest.
- Log in to the Paragon Automation management CLI.
- Type the command
/var/local/healthbot/healthbot k logs server-monitoring pod id
.