-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Plugin cURL Config
This page contains some example configurations for the cURL plugin. This page is meant as a cookbook, so if you have a configuration for an aspect not handled here or a daemon not present, please feel free to add anything that's useful for you.
The following real-world example queries the status page of a custom web-service and fetches the average time it took to handle the last 1000 requests. This is the configuration used to create the example graph on the cURL plugin page.
<Plugin curl>
<Page "banners_served_latency">
<nowiki>URL "http://localhost/status"</nowiki>
<Match>
Regex "average speed of last 1,000 banners served: *([0-9] ) *ms"
DSType "GaugeAverage"
Type "latency"
Instance "average"
</Match>
</Page>
</Plugin>
The following real-world example queries status of the NAS Thecus N2100. This Linux-based NAS does not have SNMP module, or lm_sensors modules installed, but stats could be passed via shared files. Here are the steps:
- Install SSH module on N2100
- Login and create cron entry:
*/1 * * * * cat /proc/hwm > /raid/tmp/hwm.txt
This will start dumping stats into a file every minute. - Install NFSD module on N2100
- Create NFS share for /tmp on N2100
- Mount N2100:/raid/tmp to your collectd server mount point (e.g. /mnt/sys/n2100). I mounted it as read only.
Plugin config for system and HDD temperatures, along with fan RPM is below:
<Plugin curl>
<Page "N2100">
<nowiki>URL "file:///mnt/sys/n2100/hwm.txt"</nowiki>
<Match>
Regex "Temp 1: ([0-9] )"
DSType "GaugeLast"
Type "temperature"
Instance "System"
</Match>
<Match>
Regex "Temp 2: ([0-9] )"
DSType "GaugeLast"
Type "temperature"
Instance "HDD"
</Match>
<Match>
Regex "FAN 1 RPM: ([0-9] )"
DSType "GaugeLast"
Type "fanspeed"
Instance "Fan-doubleRPM"
</Match>
</Page>
</Plugin>
Note that (at least in my case) the RPMs reported are double of the actual RPMs. Oh well... I was too lazy to write a whole Perl plugin to divide this by 2, hence the name: doubleRPM...
HWM.TXT file:
File: hwm.txt Line 1 Col 0 792 bytes
Address: 5C
Version: 15
Temp 1: 43
Temp 2: 41
FAN 1 Expected counter(MSB): 00
FAN 1 Expected counter(LSB): 9E
FAN 2 Expected counter(MSB): 00
FAN 2 Expected counter(LSB): 9E
PWM 1 Raise duty: 30
PWM 2 Raise duty: 30
PWM 1 Drop duty: 10
PWM 2 Drop duty: 10
PWM 1 duty: 9E
PWM 2 duty: 9E
Reset timer control: 50
FAN 1 in PWM mode(03)
FAN 2 in PWM mode(03)
FAN 1 RPM: 9933(0x97,151,0,97)
FAN 2 RPM: 9933(0x97,151,0,97)
FAN 1 top RPM: 12396(0x79)
FAN 2 top RPM: 12396(0x79)
Reg A0: 32 Reg B0: 32
-- cut --
References:
1. Thecus N2100 1
2. NFSD module for N2100 2
3. SSH module for N2100 3