立即与支持人员聊天
与支持团队交流

Foglight 6.1.0 - Creating Actions Field Guide

Installing CAR Files

A cartridge file can be quickly installed and enabled on the Foglight® Management Server using the browser interface. Another way of installing a cartridge is through the command line, by issuing the cartridge:install command that is included in the fglcmd package. The following procedure illustrates the process of installing a cartridge file through the Administration module in the browser interface. For complete details about the fglcmd interface and the cartridge:install command, see the Command-Line Reference Guide. For additional information about the Administration module, see the Administration and Configuration Guide.

The cartridge file, <action_name>-<version_number>.car, can be found in the build directory of your development environment. For details about the contents of this directory, see Building Target Files .

On the navigation panel, under Dashboards, choose Administration > Cartridges > Cartridge Inventory.
For information about the build directory and its contents, see Building Target Files .
a
Ensure that the File on Local Computer option is selected and click Browse.

Upon a successful execution of the above steps, your custom action is integrated with Foglight. You can now proceed to test the results of your custom actions. For details, see Testing Custom Actions .

Testing Custom Actions

You can test a newly-integrated custom action by creating a new rule and binding it to the custom action. This will cause the action to be invoked each time the rule condition is met.

The recommended approach for testing custom actions is to create a simple, time-driven custom rule that is triggered every ten seconds, with its condition set to True. This will ensure that the rule fires every ten seconds by default. Furthermore, the rule should be bound to the custom action that you are about to test. When you save the changes to the rule, you can verify if the custom action is invoked every ten seconds as specified.

The following procedure describes the process of creating a new rule and binding it to a custom action. For complete information about rules, see the Administration and Configuration Guide.

On the navigation panel, under Dashboards, choose Administration > Rules & Notifications > Create Rule.
4
On the Rule Definition dashboard, specify the following settings:
Rule Name: Specify the rule name. For example, MyCustomAction.
Rule Type: Simple Rule.
Rule Triggering: Select the Time Driven option and set its Recurrence Interval to 10 seconds.
a
Open the Conditions & Actions dashboard by clicking Next and click Fire to define a condition for that state.
b
Open the Condition tab.
Figure 2. Condition tab
c
In the Condition box, type True.
a
Open the Email Notification & Recovery Actions tab of the Conditions & Actions dashboard.
b
Ensure that Action Type is set to Entering.
c
Click Action.
Figure 4. Custom action
7
Click Finish to save your changes.

Upon successfully saving the rule, the newly-created rule invokes the custom action every ten seconds. The process of verifying the results of the custom action depends on the nature of the custom action.

 

Appendix: Code Samples

This appendix contains code samples that illustrate the contents of the files found in the development directory. You will find these file contents in the example.zip file packaged with this document. For information about the directory structure, see Creating the Directory Structure, Creating the Directory Structure .

build.xml

相关文档

The document was helpful.

选择评级

I easily found the information I needed.

选择评级