Re: ssh remote execute awk problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Les Mikesell wrote:
> On 3/17/2011 8:31 AM, Nico Kadel-Garcia wrote:
>>
>>> Quote the whole command and backslash the command quotes...
>>> ssh root@localhost "awk '/processor/{count[\"proc\"]++}; END{print
>>> count[\"proc\"] } ' /proc/cpuinfo"
>>
>> Or do the processing locally and stay away from proc nuttiness,
>> without mucking with ssh and awk.
>>
>>       grep ^processor /proc/cpuinfo | wc -l
>>
>> Or:
>>
>>       ssh -l $TARGETUSER $TARGETHOST "[ -e /proc/cpuinfo ] -a grep
>> ^processor | wc -l"
>
> Or, more extremely - if you are doing much of this kind of remote
> inventory checking, you might consider running ocsinventory-ng with
> agents on the nodes.

Yes. We use ocsinventory here. Warning: there are a few systems that
ocsinventory, or at least the version we put on last year, would literally
crash or hang the system.

           mark



_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux