[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Defining a Class based on ShellCommand Output or No Output
From: |
Frank Smith |
Subject: |
Re: Defining a Class based on ShellCommand Output or No Output |
Date: |
Fri, 05 Aug 2005 11:07:20 -0500 |
--On Friday, August 05, 2005 11:48:40 -0400 "Brian E. Seppanen"
<seppy@chartermi.net> wrote:
> On Thu, 4 Aug 2005, Ed Brown wrote:
>
>> This uses ReturnsZero, but not a secondary script. Also, it was tested
>> on linux. Would something like this work for you:
>>
>> classes:
>> SmcOn = ( ReturnsZero(/bin/sh -c "netstat -ln |grep -q 898") )
>
>
> Thanks for the additional syntax hints. On solaris I ended up having to use
> smcstop = ( ReturnsZero(/usr/xpg4/bin/sh -c "/usr/bin/netstat -an |
> /usr/xpg4/bin/grep -q 898")
>
> before it would work...
>
> Somewhat offtopic, but would anyone mind giving a brief synopsis of what the
> /usr/xpg4 stuff is?
It's the POSIX-compliant versions of various utilities. 'man xpg' for more
details.
Frank
>
> I didn't realize I was going to have to initiate it's own shell to accomplish
> it, but I got a bunch of errors without initiating /usr/xpg4/bin/sh.
>
> I tried ( ReturnsZero(/usr/bin/netstat -an | /usr/xpg4/bin/grep -q 898) )
> and got invalid argument arguments for netstat
>
> I tried it with single quotes and double ( ReturnsZero('/usr/bin/netstat -an
> | /usr/xpg4/bin/grep -q 898') )
> ( ReturnsZero("/usr/bin/netstat -an | /usr/xpg4/bin/grep -q 898") )
>
> cf:cfengine::/var/cfengine/os/solaris/cf.solaris:18: ExecResult(/command)
> must specify an absolute path
>
>
> The good news is it works now. Thanks for the help.
>
> Brian Seppanen
> 608.826.1464
>
>
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-cfengine
--
Frank Smith fsmith@hoovers.com
Sr. Systems Administrator Voice: 512-374-4673
Hoover's Online Fax: 512-374-4501