<def-group>
  <definition class="compliance" id="sysctl_static_%SYSCTLID%" version="3">
    <metadata>
      <title>Kernel "%SYSCTLVAR%" Parameter Configuration Check</title>
      <affected family="unix">
        <platform>SUSE Linux Enterprise 12</platform>
      </affected>
      <description>The kernel "%SYSCTLVAR%" parameter should be set to the appropriate value in the system configuration.</description>
    </metadata>
    <criteria operator="OR">
      <criterion comment="kernel static parameter %SYSCTLVAR% set to the appropriate value in /etc/sysctl.conf" test_ref="test_static_sysctl_%SYSCTLID%" />
      <!-- see sysctl.d(5) -->
      <criterion comment="kernel static parameter %SYSCTLVAR% set to the appropriate value in /etc/sysctl.d/*.conf" test_ref="test_static_etc_sysctld_%SYSCTLID%" />
      <criterion comment="kernel static parameter %SYSCTLVAR% set to the appropriate value in /run/sysctl.d/*.conf" test_ref="test_static_run_sysctld_%SYSCTLID%" />
      <criterion comment="kernel static parameter %SYSCTLVAR% set to the appropriate value in /usr/lib/sysctl.d/*.conf" test_ref="test_static_usr_lib_sysctld_%SYSCTLID%" />
    </criteria>
  </definition>

  <ind:textfilecontent54_test check="all" check_existence="all_exist" comment="%SYSCTLVAR% static configuration" id="test_static_sysctl_%SYSCTLID%" version="1">
    <ind:object object_ref="object_static_sysctl_%SYSCTLID%" />
    <ind:state state_ref="state_static_sysctld_%SYSCTLID%" />
  </ind:textfilecontent54_test>

  <ind:textfilecontent54_test check="all" comment="%SYSCTLVAR% static configuration in /etc/sysctl.d/*.conf" id="test_static_etc_sysctld_%SYSCTLID%" version="1">
    <ind:object object_ref="object_static_etc_sysctld_%SYSCTLID%" />
    <ind:state state_ref="state_static_sysctld_%SYSCTLID%" />
  </ind:textfilecontent54_test>

  <ind:textfilecontent54_test check="all" comment="%SYSCTLVAR% static configuration in /etc/sysctl.d/*.conf" id="test_static_run_sysctld_%SYSCTLID%" version="1">
    <ind:object object_ref="object_static_run_sysctld_%SYSCTLID%" />
    <ind:state state_ref="state_static_sysctld_%SYSCTLID%" />
  </ind:textfilecontent54_test>

  <ind:textfilecontent54_test check="all" comment="%SYSCTLVAR% static configuration in /etc/sysctl.d/*.conf" id="test_static_usr_lib_sysctld_%SYSCTLID%" version="1">
    <ind:object object_ref="object_static_usr_lib_sysctld_%SYSCTLID%" />
    <ind:state state_ref="state_static_sysctld_%SYSCTLID%" />
  </ind:textfilecontent54_test>

  <ind:textfilecontent54_object id="object_static_sysctl_%SYSCTLID%" version="1">
    <ind:filepath>/etc/sysctl.conf</ind:filepath>
    <ind:pattern operation="pattern match">(?:^|.*\n)[^#]*%SYSCTLVAR%[\s]*=[\s]*(\d+)[\s]*\n</ind:pattern>
    <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_object id="object_static_etc_sysctld_%SYSCTLID%" version="1">
    <ind:path>/etc/sysctl.d</ind:path>
    <ind:filename operation="pattern match">^.*\.conf$</ind:filename>
    <ind:pattern operation="pattern match">(?:^|.*\n)[^#]*%SYSCTLVAR%[\s]*=[\s]*(\d+)[\s]*\n</ind:pattern>
    <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_object id="object_static_run_sysctld_%SYSCTLID%" version="1">
    <ind:path>/run/sysctl.d</ind:path>
    <ind:filename operation="pattern match">^.*\.conf$</ind:filename>
    <ind:pattern operation="pattern match">(?:^|.*\n)[^#]*%SYSCTLVAR%[\s]*=[\s]*(\d+)[\s]*\n</ind:pattern>
    <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_object id="object_static_usr_lib_sysctld_%SYSCTLID%" version="1">
    <ind:path>/usr/lib/sysctl.d</ind:path>
    <ind:filename operation="pattern match">^.*\.conf$</ind:filename>
    <ind:pattern operation="pattern match">(?:^|.*\n)[^#]*%SYSCTLVAR%[\s]*=[\s]*(\d+)[\s]*\n</ind:pattern>
    <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_state id="state_static_sysctld_%SYSCTLID%" version="1">
    <ind:subexpression operation="equals"  var_ref="sysctl_%SYSCTLID%_value" datatype="int" />
  </ind:textfilecontent54_state>

  <external_variable comment="External variable for %SYSCTLVAR%" datatype="int" id="sysctl_%SYSCTLID%_value" version="1" />
</def-group>
