2 Replies Latest reply on Jul 26, 2007 11:39 AM by Andrew Knott

    How Do You Do A Compliance Rule if There Is Only One Value?

      Someone should know this off the top of their head. I've been digging through existing compliance rules, and I don't see anything like this.


      I want to evaluate a file, to see if "/proc/sys/kernel/sem" is set to 250 or greater.


      The problem is that there isn't a pair of values. It's a single entry.


      So if I add it as a configuration entry, the NAME of the config entry gets set to whatever the value.


      Which means that the rule will break if it's anything BUT 250.


      Sure, I could do this with an extended object, but it would be a lot more elegant to do it with a compliance rule.


      How do you do it?


      I considered taking a snapshot of the value, then using that to set the value on the managed host. But going that route locks me into one value, and I'd really like to evaluate whether "/proc/sys/kernel/sem" is set to 250 or higher.

        • 1. Re: How Do You Do A Compliance Rule if There Is Only One Value?

          Hey John,


          I am assuming you are creating a new configuration object (not extended) using a specified grammar. Which grammar are you using, split on space or single line?


          A custom grammar could be created to use a hardcoded value as the key, then take the first non-space characters as the first value. Another option is to create an artificial sequence for each line in the file and use that as the key. This should be easily modeled off of the "first line value" grammar.


          This will provide you with the pair of values you are looking for. Unfortunately, I have not got around to coding the grammar so I can't help you on that just yet :)

          • 2. Re: How Do You Do A Compliance Rule if There Is Only One Value?

            Is /proc/sys/kernel/sem a single lined file with values? If so, you can use a grammar that has the "name" and "value 1" to be the first entry.


            # cat /proc/sys/kernel/sem
            250 32000 32 128


            could have a condition such as:

            proc/sys/kernel/sem//* should exist and
            Value 1 as Integer >= 250