Guest User!

You are not Sophos Staff.

This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

confd-client.plx - making changes from the command line v2.0

Hello!

I've about 250 ASG's with wrong ACC-server address in their options (server IP-address has been changed). I want to use a script which will correct IP-address.  I use plink.exe for ssh connection. The output of get_object function is below:
astaro:/home/login # cc get_object REF_VctZAbInbK 

get_object returned {
          'lock' => '',
          'ref' => 'REF_VctZAbInbK',
          'data' => {
                      'resolved6' => 0,
                      'address6' => '',
                      'comment' => '',
                      'name' => 'ACC',
                      'interface' => '',
                      'resolved' => 1,
                      'address' => '10.10.37.200'
                    },
          'hidden' => 0,
          'class' => 'network',
          'type' => 'host',
          'nodel' => ''
        }

  
Now I need to change 'address' value - how can I do this? 

I've tried to do this with tool cc->OBJS->network->host, but it doesn't work through plink. I get "Cannot open /dev/tty for read at confd-client.pl line 159" error. 
I think that's because cc starts something like it's own shell, so input from my script doesn't work. 
I think I need the only one command to change IP-address, so I've tried to use set_object but I don't know right syntax. I receive "Bareword "REF_VctZAbInbK" not allowed while "strict subs" in use at (eval 78) line 1" error. 

Could anybody tell me, how can I change the value of my ACC-server IP address? Thanks in advance!


This thread was automatically locked due to age.
  • I need to read manuals more carefully [:)] Phrase "The full representation of the object must be given as the only argument" is the key. That's done the trick
  • I have been looking for a similar command - tough to enable or disable an object. At last i managed to find this:
    enable: cc change_object REF_xyz status 1
    disable: cc change_object REF_xyz status 0

    But you mention that you need to read the manual more carefully. Do you really have a manual for the command line / confd? If so I would love to get a copy, could you post it or PM me?
  • Changing the ACC server definition is tricky, because the reference name will be different on each ASG system.

    Try the following perl code to get the ACC server object and change the IP address to 1.1.1.1:

    perl -e 'use Astaro::ConfdPlRPC; my $ip = shift || die "Please enter IP as argument"; my $sys = new Astaro::ConfdPlRPC(); my $acc = $sys->get('acc','server1','server') || die "No ACC object set"; $sys->change_object($acc, 'address', $ip);' 1.1.1.1


    Cheers
     Ulrich