Tools pmie pmval pmchart pmieconf pmdashping
This tutorial covers customization of pmie rules using pmieconf. For an explanation of Performance Co-Pilot terms and acronyms, consult the PCP glossary.
It is advisable to first read the comprehensive introductory pmie tutorial before tackling this one.
In this exercise we create a scenario which exhibits the sort of behaviour that might be of concern in a production environment. We'll then use several PCP tools to detect, identify and understand the problem.
Create your own pmie rules using pmieconf:
$ pmieconf -f myrules pmieconf> disable all pmieconf> enable cpu.context_switch pmieconf> modify global delta "5 sec" pmieconf> modify global holdoff "" pmieconf> modify global syslog_action no pmieconf> modify global user_action yes pmieconf> quitDetermine what this command sequence has done by:
$ pmie -c myrulesTerminate pmie and use the reported values from pmchart to determine what the average rate of system calls is. Then re-run pmieconf to adjust the threshold level up or down to alter the behaviour of pmie. Re-run pmie.
$ pmieconf -f myrules pmieconf> modify cpu.context_switch threshold 5000 # <-- insert suitable value here pmieconf> quit $ pmie -c myrules
The default shping configuration is $PCP_PMDAS_DIR/shping/sample.conf. The comments explain the syntax.
Create a new configuration file, say $PCP_PMDAS_DIR/shping/my.conf, with shell tag and command of the form:
no-pmie test ! -f /tmp/no-pmie
# cd $PCP_PMDAS_DIR/shping # ./InstallMostly take the defaults, other than specifying your own configuration file (my.conf) and setting the cycle time to 5 (seconds); don't worry about the timeout period, as timeouts are not going to happen in this configuration of the agent.
In one window, use pmval to monitor shping.status.
In a command shell:
$ pmval -t 5 shping.status
In another window, first create the file /tmp/no-pmie, wait ten seconds, and then remove the file. Observe what pmval reports in the other window. Terminate pmval.
Using your editor of choice, edit the pmieconf output file created earlier, i.e. myrules. Append a new rule at the end (after the END GENERATED SECTION line), that is a copy of the cpu.context_switch rule.
To this new rule, add the following conjunct before the action line (containing ->), modify the message in the new rule's action to be different to the standard rule, make sure the threshold is low enough for the predicate to be true, and then save the file.
&& shping.status #'no-pmie' == 0
Re-run pmieconf to disable the standard rule:
$ pmieconf -f myrules pmieconf> disable cpu.context_switch pmieconf> quitInspect the re-created file myrules. Check your new rule is still there and the standard rule has been removed.
Run pmie using myrules, and verify that your new alarm messages appear on standard output. In another window, create the file /tmp/no-pmie, wait a while, then remove the file.
Notice there may be some delay between the creation or removal of /tmp/no-pmie and the change in pmie behaviour. Can you explain this?