Tonight I created a example on how to use a Linux/UNIX command to return data as performance data in OM12. In this example we build a rule that count files in a folder and returns it as performance data.
- In the Operations Manager console, navigate to Author/Management Pack Objects/Rules
- Right-click rules and create a new Rule, select Collection Rules/Probe Based/UNIX/Linux Shell Command (Performance) rule
- Select a management pack
- General, input a name and a rule target. For example “Field – X plat – Number of files” as name and “SUSE Linux Enterprise Computer” as monitor target
- Schedule, select how often you want the rule to run the command, for example every 15 minute
- Shell Command Details, input the script you want to use. The command can be a path to a binary or script file or a single-line shell command. In this example we can the following command to count files in the /tmp folder
find /tmp | wc -l
- Filter Expression, use default settings and click Next
- Performance Mapper, input name of object, counter and instance, for example
Object: Folder Management
Counter: Number of files
- Click Create and your rule is ready!
You can now navigate to a performance view and show the data collected by the rule (might need to wait some minutes depending on your rule settings)