Customize the Default Machine Agent Metric Collection
- Locate the
task-template.xml
file. This file is located in the<machine_agent_home>/monitors/JavaHardwareMonitor/
directory when the Machine Agent starts the first time. - Edit the task-template.xml file:
- To enable aggregation operation for localhost (lo) network metrics, change the value of the aggregate attribute (for the network element "lo") to "true".
- To enable monitoring for a virtual disk, set the value of the enabled attribute to "true" for that disk.
<config> <disk aggregate="false" enabled="false">sunrpc</disk> <disk aggregate="true" enabled="true">/dev/sdb1</disk> <disk aggregate="false" enabled="false">proc</disk> <disk aggregate="false" enabled="false">none</disk> <disk aggregate="false" enabled="false">devpts</disk> <disk aggregate="true" enabled="true">/dev/sda1</disk> <disk aggregate="false" enabled="false">nfsd</disk> <disk aggregate="true" enabled="true">/dev/mapper/saas4-binlog</disk> <disk aggregate="false" enabled="false">sysfs</disk> <disk aggregate="false" enabled="false">tmpfs</disk> <network aggregate="true" enabled="true">lo</network> <network aggregate="true" enabled="false">sit0</network> <network aggregate="true" enabled="true">eth0:1</network> <network aggregate="true" enabled="true">eth0</network> <network aggregate="true" enabled="false">eth1</network> </config>
- To prevent the Machine Agent from overwriting the file, rename the
task-template.xml
file totask.xml
. - To monitor a special device that is not enabled, add a file named
task.xml
in the<machine_agent_home>/monitors/JavaHardwareMonitor/
directory.The format of thetask.xml
file must be exactly the same format as thetask-template.xml
file. Not all disks and networks must be included in thetask.xml
file. If the Machine Agent finds a disk or a network that is not in thetask.xml
file, then it applies the default properties. - Restart the Machine Agent.