mandriva

Pulse 2 Client Check

Nicolas Rueff

$Id$

Revision History
Revision 1.2.42009-08-25NR

First version.

Abstract


1. Introduction

Pulse 2 has the possibility to perform some check prior to perform an operation on its clients. This is what we call 'client check'.

"Client checking" consists in 3 checks :

  • to ask the client if the informations the server know about it are right,

  • to announce the current operation,

  • to ask the client to give us some informations about its configuration, to perform checks server side.

The following chapter will describe this in details.

2. Client check syntax

As previously told, 3 checks can be asked :

--verify

the client is in-charge to verify that the informations given by the server are relevant

--action

the server announces which stage of a deployment it is currently performing

--show

the server asks the client to display (on stdout) some informations, which will be checked later server-side

Some additional args can be given :

--help

display the client check usage

--verbose

the client will write on stderr each operation it performed

--debug

activate the verbose mode, plus forces "-x" on the shell interpreter.

In other words :

pulse2-client-check [--verify arg=value[,arg2=value2,...]] [--show arg[,arg2,...]] [--action action[,action2,...]] [--verbose] [--debug] [--help]

2.1. --verify

This is the first (in chronological order) operation to be done.

Syntax is :

arg=value[,arg2=value2][,arg3=value3][,...]

arg can be :

IP

the client will verify that the value given is an IP which can be found on the client; for example on a client with two IP addresses 192.168.0.1 and 172.20.0.1 :

-bash-3.2$ pulse2-client-check.sh --verify IP=192.168.0.1; echo $?
0
-bash-3.2$ pulse2-client-check.sh --verify IP=192.168.0.0; echo $?
IP Address mismatch ! Wanted "192.168.0.0", found "192.168.0.1 172.20.0.1"
1

Please note that :

  • the script will give up as soon as one IP address searched do not matches,

  • the check can be activated by setting "client_check = IP=ipaddr" in scheduler.ini.

MAC

the client will verify that the value given is an MAC address (case-insensitive) which can be found on the client; for example on a client with two MAC addresses 00:11:22:33:44:55 and ff:ee:dd:cc:bb:aa :

-bash-3.2$ pulse2-client-check.sh --verify MAC=00:11:22:33:44:55; echo $?
0
-bash-3.2$ pulse2-client-check.sh --verify MAC=00:00:00:00:00:00; echo $?
MAC Address mismatch ! Wanted "00:00:00:00:00:00", found "00:11:22:33:44:55 ff:ee:dd:cc:bb:aa"
1

Please note that :

  • the script will give up as soon as one MAC address searched do not matches,

  • the check can be activated by setting "client_check = MAC=macaddr" in scheduler.ini.

HOSTNAME

the client will verify that the value given (case-insensitive) corresponds to the client hostname; for example on a client whose name is "WINDOWSXP" :

-bash-3.2$ pulse2-client-check.sh --verify HOSTNAME=WINDOWSXP; echo $?
0
-bash-3.2$ pulse2-client-check.sh --verify HOSTNAME=WRONGHOSTNAME; echo $?
Hostname mismatch ! Wanted "WRONGHOSTNAME", found "WINDOWSXP"
1

Please note that :

  • the check can be activated by setting "client_check = HOSTNAME=name" in scheduler.ini.

Different args can of course be combined :

-bash-3.2$ pulse2-client-check.sh --verify MAC=00:11:22:33:44:55,HOSTNAME=WINDOWSXP,IP=192.168.0.1; echo $?
0
-bash-3.2$ pulse2-client-check.sh --verify MAC=00:11:22:33:44:55,HOSTNAME=WRONGHOSTNAME,IP=192.168.0.1; echo $?
Hostname mismatch ! Wanted "WRONGHOSTNAME", found "WINDOWSXP"
1

2.2. --action

This is the second (in chronological order) operation to be done.

Syntax is :

action[,action2,...]

action can be anything, it is only used to tell the client that an operation will be performed, it is up-to the client to decide whenever aboard or not. Not yet implemented (read : will always succeed).

Please note that :

  • the check can be activated by setting "announce_check = (comma-separated actions) " in scheduler.ini. Actions can be any of "transfert, execute, delete, inventory, reboot, halt, download", the scheduler will then use them if applicable; for example with announce_check = execute,delete :

    • in "upload" phase, "pulse2-client-check" will be run without additional arg,

    • in "execution" phase, "pulse2-client-check" will be run with "--action execute"

    • in "deletion" phase, "pulse2-client-check" will be run with "--action delete".

2.3. --show

This is the third (in chronological order) operation to be done.

Syntax is :

arg[,arg2][,arg3][,...]

arg can be :

IP

the client will print its IP addresses on stdout; for example on a client with two IP addresses 192.168.0.1 and 172.20.0.1 :

-bash-3.2$ pulse2-client-check.sh --show IP
IP=192.168.0.1
IP=172.20.0.1

Please note that :

  • the check can be activated by setting "server_check = IP=ipaddr" in scheduler.ini,

  • the check will be performed by the server: success if at least one of the IP addresses matches, or failed.

MAC

the client will print its MAC addresses on stdout; for example on a client with two MAC addresses 00:11:22:33:44:55 and ff:ee:dd:cc:bb:aa :

-bash-3.2$ pulse2-client-check.sh --show MAC
MAC=00:11:22:33:44:55
MAC=ff:ee:dd:cc:bb:aa

Please note that :

  • the check can be activated by setting "server_check = MAC=macaddr" in scheduler.ini.

  • the check will be performed by the server: success if at least one of the MAC addresses matches, or failed.

HOSTNAME

the client will print its hostname on stdout; for example on a client whose name is "WINDOWSXP" :

-bash-3.2$ pulse2-client-check.sh --show HOSTNAME
HOSTNAME=WINDOWSXP

Please note that :

  • the check can be activated by setting "server_check = HOSTNAME=name" in scheduler.ini.

  • the check will be performed by the server: success if the hostname matches, or failed.

Different args can of course be combined :

-bash-3.2$ pulse2-client-check.sh --show IP,MAC,HOSTNAME; echo $?
IP=192.168.0.1
IP=172.20.0.1
MAC=00:11:22:33:44:55
MAC=ff:ee:dd:cc:bb:aa
HOSTNAME=WINDOWSXP

Note: IP and MAC are always given in the same order (first IP <-> first MAC, etc ...).