[Spacewalk-list] ISE Executing Remote Commands via SSM

Wojtak, Greg (Superfly) GregWojtak at quickenloans.com
Mon Aug 20 13:13:51 UTC 2012


I changed the script around slightly and got it to work.  The failing line
was the 

SPACEHOST=$(awk -F= '/^serverURL=/ {print $2}'
/etc/sysconfig/rhn/up2date|sed 's+.*//\(.*\)/XMLRPC+\1+')


I removed the pipe to sed and modified my awk statement a bit.  Getting
rid of the sed cleared it up completely, so scheduling a remote command on
one or many servers results in an ISE with something in the following:

sed 's+.*//\(.*\)/XMLRPC+\1+'

I'm guessing one or more characters is not getting escaped properly
(perhaps the backslashes)?

Greg Wojtak
Sr. Unix Systems Engineer
Office: (313) 373-4306
Cell: (734) 718-8472





On 2012-08-17 11:03 AM, "Wojtak, Greg (Superfly)"
<GregWojtak at quickenloans.com> wrote:

>Sorry for the influx of emails - it turns out that simple scripts DO work.
> I get the ISE consistently when running the following script:
>
>#!/bin/bash
>
>DNSDOMAINNAME=$(dnsdomainname)
>THISHOST=$(hostname -s)
>GATEWAY=$(route -n|awk '/^0.0.0.0/ {print $2}')
>SPACEHOST=$(awk -F= '/^serverURL=/ {print $2}'
>/etc/sysconfig/rhn/up2date|sed 's+.*//\(.*\)/XMLRPC+\1+')
>
>echo $DNSDOMAINNAME
>echo $THISHOST
>echo $GATEWAY
>echo $SPACEHOST
>
>spacecmd -y -u apiuser -p apiuser -s $SPACEHOST system_addcustomvalue
>${THISHOST} gateway ${GATEWAY}
>spacecmd -y -u apiuser -p apiuser -s $SPACEHOST system_addcustomvalue
>${THISHOST} dnsdomainname ${DNSDOMAINNAME}
>
>
>
>Greg Wojtak
>Sr. Unix Systems Engineer
>Office: (313) 373-4306
>Cell: (734) 718-8472
>
>
>
>
>
>On 2012-08-17 10:47 AM, "Wojtak, Greg (Superfly)"
><GregWojtak at quickenloans.com> wrote:
>
>>Actually, I'm getting this even when scheduling a remote command on a
>>single server... Not sure what gives because I got the remote commands
>>working and verified with a simple execution of a remote command - ie,
>>'touch /tmp/this_is_from_spacewalk'
>>
>>
>>
>>Greg Wojtak
>>Sr. Unix Systems Engineer
>>Office: (313) 373-4306
>>Cell: (734) 718-8472
>>
>>
>>
>>
>>
>>On 2012-08-17 10:33 AM, "Wojtak, Greg (Superfly)"
>><GregWojtak at quickenloans.com> wrote:
>>
>>>Hello,
>>>
>>>I received a 500 error scheduling remote commands to run on several
>>>systems via SSM.  Cent 6 64-bit, Spacewalk 1.6, PostgreSQL.  Here is the
>>>error from the apache error_log:
>>>
>>>[Fri Aug 17 10:26:33 2012] [error] Execution of
>>>/var/www/html/network/systems/ssm/provisioning/remote_command_conf.pxt
>>>failed at Fri Aug 17 10:26:33 2012: RHN::Exception: DBD::Pg::st execute
>>>failed: ERROR:  invalid input syntax for type bytea\n  RHN::DB
>>>/usr/share/perl5/vendor_perl/RHN/DB.pm 228 RHN::Exception::DB::throw\n
>>>RHN::DB::st /usr/share/perl5/vendor_perl/RHN/DB.pm 564
>>>RHN::DB::handle_error\n  RHN::DB::Scheduler
>>>/usr/share/perl5/vendor_perl/RHN/DB/Scheduler.pm 1564
>>>RHN::DB::st::execute_h\n  Sniglets::ListView::SystemList
>>>/usr/share/perl5/vendor_perl/Sniglets/ListView/SystemList.pm 391
>>>RHN::DB::Scheduler::schedule_remote_command\n
>>>Sniglets::ListView::SystemList
>>>/usr/share/perl5/vendor_perl/Sniglets/ListView/SystemList.pm 381
>>>(eval)\n
>>> Sniglets::ListView::List
>>>/usr/share/perl5/vendor_perl/Sniglets/ListView/List.pm 374
>>>Sniglets::ListView::SystemList::ssm_remote_command_action_cb\n
>>>Sniglets::Lists /usr/share/perl5/vendor_perl/Sniglets/Lists.pm 135
>>>Sniglets::ListView::!
>>> List::callback\n  PXT::ApacheHandler
>>>/usr/share/perl5/vendor_perl/PXT/ApacheHandler.pm 489
>>>Sniglets::Lists::listview_cb\n  PXT::ApacheHandler
>>>/usr/share/perl5/vendor_perl/PXT/ApacheHandler.pm 103
>>>PXT::ApacheHandler::pxt_parse_data\n  PXT::ApacheHandler
>>>/usr/share/perl5/vendor_perl/PXT/ApacheHandler.pm 103 (eval)\n  main -e
>>>0
>>>PXT::ApacheHandler::handler\n  main -e 0 (eval)
>>>
>>>
>>>Greg Wojtak
>>>Sr. Unix Systems Engineer
>>>Office: (313) 373-4306
>>>Cell: (734) 718-8472
>>>
>>>
>>>_______________________________________________
>>>Spacewalk-list mailing list
>>>Spacewalk-list at redhat.com
>>>https://www.redhat.com/mailman/listinfo/spacewalk-list
>>
>>
>>_______________________________________________
>>Spacewalk-list mailing list
>>Spacewalk-list at redhat.com
>>https://www.redhat.com/mailman/listinfo/spacewalk-list
>
>
>_______________________________________________
>Spacewalk-list mailing list
>Spacewalk-list at redhat.com
>https://www.redhat.com/mailman/listinfo/spacewalk-list





More information about the Spacewalk-list mailing list