DX NetOps Manager

Policy Manager 

Jan 31, 2012 07:55 AM

Back to:

CA Spectrum

IM Community WIKI Front Page

 

 

How to use PolicyManager?

 

The PolicyManager provides an easy way to override default settings of Spectrum or activate/modify watches etc. Here you will find the steps to successfully use this utility.

 

  • You need to copy the default files from within your $SPECHOME/PolicyMgmt/Spectrum/*.xml to $SPECHOME/PolicyMgmt
  • Then you'll have to change the file permissions so they are no longer "read-only"
  • Search for the Attribute you would like to change and the ModelType. In my example it is the Pingable ModelType and the Value when Red Attribute which I would like to change globally. So grab the ID's either via vnmsh or with the AttributeBrowser in your Spectrum 9.0. (If you are still on 8.x or even 7.x you may use SpectroGraph Attribute Browser to get the ID's. Here are the steps in vnmsh:
    1. change into $SPECROOT/vnmsh
    2. execute connect
    3. show devices | grep -i Pingable
    4. choose one of the models shown in the result and put a current mh=MODELHANDLE from the list
    5. show attributes | more
    6. now you may write down the attribe-id's you need
    7. don't forget to disconnect when you are finished
  • Edit the file policy-enforcement-config.xml with you favorite editor and change the line policy-enforcement-mode mode="DISABLED" to ENABLED and save the file.
  • Now we need to put in a filter to determine which Objects of Spectrum we would like to change. Therefore open '''policy-search-criteria.xml''' with your editor.
  • On the very bottom of the file just above the line with /policy-search-criteria put in your filter statement. (The id of 0x10000 is the attribute id for ModelType) For my example it looks like this:
    <policy-search-criteria name="Pingable">
      <and>
          <attr-match match-type="equal-to" id="0x10000" value="Pingable" />
      </and>
    </policy-search-criteria>
  • Save the file and open policy-settings.xml with an editor of choise to define the settings we would like to change.
  • Just before the last line in the file I have added the following to change my Value_When_Red attribute (0x1000e) to 7 which would mean generate red alarm:
    <policy-settings name="ValueWhenRed">
      <set-attr-value id="0x1000e" value="7" />
    </policy-settings>
  • After saving the file we need to tell Spectrum which Policy-Setting-Definition should be applied to which Filter. Open '''policy-rules.xml''' in your editor. Put in your search criteria name you gave before and your policy-settings name you've set in the last step. For my example it looks like this:
    <policy-rule name="PingableRed" >
        <device-policy-search-criteria-name name="Pingable" />
        <policy-settings-name name="ValueWhenRed" />
    </policy-rule>
  • Finally I have added this policy-rule name to the file '''policies.xml''' between <nowiki><policy name="Alarm Thresholding Policy"> and </policy></nowiki> so it looks like this:
    <policy name="Alarm Thresholding Policy">
        <policy-rule-name name="PingableRed" />
    </policy>
  • All you have to do now is going to your OneClick, select the PolicyManager, in your Information Tab expand the Configuration and click on Reload.

 

Thanks to Christian_Schneider

 

How to reduce Bad Link Error with the Policy Manager

With this post I would like to extend the great examples of Christian description with two necessary policy for reduce Bad Link Error.

 

The Policy Disable Port Monitoring turns off the monitoring of the port, which meets the search criteria

  • is a Port
  • Attr. 0x12a79 = 0

 

The Policy "Enable Port Monitoring" turns on the monitoring of the port, which meets the search criteria

  • is a Port
  • Attr. 0x12a79 != 0

 

As described in the post above:

  • You need to copy the default files from within your $SPECHOME/PolicyMgmt/Spectrum/ to $SPECHOME/PolicyMgmt
    - policies.xml
    - policy-rules.xml
    - policy-settings.xml
    - policy-enforcement-config.xml
    - policy-search-criteria.xml
  • Then you'll have to change the file permissions so they are no longer "read-only"


The next steps are only to reduce Bad Link Error on Ports

  • Open with an Editor the File policies.xml
  • Add the following Lines between <nowiki><policy name="Port Fault Management Policy"> and </policy> so it looks like this:
    <nowiki><policy name="Port Fault Management Policy">
    <policy-rule-name name="Enable Port Monitoring"/>
    <policy-rule-name name="Disable Port Monitoring"/>
    </policy>
    </nowiki>
  • save and close the policies.xml File

 

  • Open with an Editor the File policy-rules.xml
  • Add the following Lines between <nowiki><policy-rule-definitions> and </policy-rule-definitions> so it looks like this:
    <policy-rule-definitions>
        <policy-rule name="Disable Port Monitoring">
            <port-policy-search-criteria-name name="No Link"/>
            <policy-settings-name name="PortNotAlarmSettings"/>
        </policy-rule>

        <policy-rule name="Enable Port Monitoring">
            <port-policy-search-criteria-name name="Any Link"/>
            <policy-settings-name name="PortAlarmSettings"/>
        </policy-rule>
    </policy-rule-definitions>
  • save and close the policy-rules.xml File

 

  • Open with an Editor the File policy-settings.xml
  • Add the following Lines between <nowiki><policy-settings-definitions> and </policy-settings-definitions> so it looks like this:
    <policy-settings-definitions>
        <policy-settings name="PortNotAlarmSettings">
            <set-attr-value id="0x1280a" value="FALSE" />
            <set-attr-value id="0x11dd8" value="FALSE" />
            <set-attr-value id="0x11fc2" value="0" />
            <set-attr-value id="0x12957" value="FALSE" />
            <set-attr-value id="0x12a54" value="FALSE" />
        </policy-settings>
        <policy-settings name="PortAlarmSettings">
            <set-attr-value id="0x1280a" value="FALSE" />
            <set-attr-value id="0x11dd8" value="TRUE" />
            <set-attr-value id="0x11fc2" value="1" />
            <set-attr-value id="0x12957" value="FALSE" />
            <set-attr-value id="0x12a54" value="TRUE" />
        </policy-settings>
    </policy-settings-definitions>
  • save and close the policy-settings.xml File

 

  • Edit the file policy-enforcement-config.xml with an editor and change the line policy-enforcement-mode mode="DISABLED" to ENABLED and save the file.

 

  • Open with an Editor the File policy-search-criteria.xml
  • Add the following Lines between <nowiki><policy-search-criteria-definitions> and </policy-search-criteria-definitions> so it looks like this:

<policy-search-criteria-definitions>


  <policy-search-criteria name="Ports">
      <or>
        <attr-match match-type="equal-to" id="0x11dd8" value="TRUE" />
        <attr-match match-type="equal-to" id="0x11dd8" value="FALSE" />
      </or>
  </policy-search-criteria>

 

  <!--
    We search a Port with the Attr. Value 0x12a79 = 0
    0 = No Link
  -->

  <policy-search-criteria name="No Link">
      <and>
        <policy-search-criteria-name name="Ports" />
        <attr-match match-type="equal-to" id="0x12a79" value="0" />
      </and>
  </policy-search-criteria>

 

  <!--
    We search a Port with the Attr. Value 0x12a79 != 0
  -->

  <policy-search-criteria name="Any Link">
      <and>
        <policy-search-criteria-name name="Ports" />
        <attr-match match-type="not-equal-to" id="0x12a79" value="0" />
      </and>
  </policy-search-criteria>

 

</policy-search-criteria-definitions>

  

Statistics
0 Favorited
7 Views
0 Files
0 Shares
0 Downloads

Related Entries and Links

No Related Resource entered.