Mass shutdown / wakeup

Antworten
shade
Beiträge: 49
Registriert: 10 Aug 2012, 15:14

Mass shutdown / wakeup

Beitrag von shade »

Hello,

Is there a way to send a shutdown command to ALL computers in the OPSI database from the servers command line ? and also the same for wakeup ?
mirkt
Beiträge: 95
Registriert: 05 Jun 2013, 09:39
Wohnort: Lithuania

Re: Mass shutdown / wakeup

Beitrag von mirkt »

# opsi-admin -d method hostControl_shutdown '*'
# opsi-admin -d method hostControl_start '*'

?
shade
Beiträge: 49
Registriert: 10 Aug 2012, 15:14

Re: Mass shutdown / wakeup

Beitrag von shade »

Thanks ;)
shade
Beiträge: 49
Registriert: 10 Aug 2012, 15:14

Re: Mass shutdown / wakeup

Beitrag von shade »

Shutdown works fine, but startup does not happen (because of broadcast domains, vlans and so on).

Is it possible to dump the mac-address result from:

# opsi-admin -d method hostControl_start '*'

To run on other machine with access to the vlans, or can parts of OPSI be installed on does machines so that command can be run there ?
mirkt
Beiträge: 95
Registriert: 05 Jun 2013, 09:39
Wohnort: Lithuania

Re: Mass shutdown / wakeup

Beitrag von mirkt »

You could loop:
# opsi-admin -d method getMacAddress CLIENT_ID
for each client..

also there is method: host_getObjects('*attributes', '**filter')..

I guess it should return only certain attributes of hosts matched by filter, but I am not sure how to pass arguments in order to get "hardwareAddress" (and maybe "ipAddress") of hosts with "type" : "OpsiClient"..

so you can simply run:
# opsi-admin -d method host_getObjects

and grep only what is needed..
shade
Beiträge: 49
Registriert: 10 Aug 2012, 15:14

Re: Mass shutdown / wakeup

Beitrag von shade »

Thanks for input.

grep seems the fastest way, so ended up with:

opsi-admin -d method host_getObjects | grep "hardwareAddress" | cut -c 32-48
Antworten