Command Line to verify registration and patch management

Hi to all,

I’ve beeb looking for a command line tool that can tell me the following:

I need to build a script to run on a very huge env…

  • If a SLES (10, 11) is registered/activated;
  • If the server is allowed to have patch/updates dowloaded;

So far suse_register only seems to allow me to register, not to check it and rug/zypper only tells me if I have updates/patchs …

Any help is welcome !

regards.

JG

In article jg_cnenet.5mr1bz@no-mx.forums.suse.com, Jg cnenet wrote:[color=blue]

I need to build a script to run on a very huge env…

  • If a SLES (10, 11) is registered/activated;
  • If the server is allowed to have patch/updates dowloaded;
    [/color]

You’ll have to have separate streams for 10 vs 11 because of the change
zmd to zyyper
It a server is activated (even if now broken), there are specific files
that will exist. You can see where they are in TID 3303599
http://www.novell.com/support/kb/doc.php?id=3303599

testing the results of ‘rug sl’(10) or ‘zypper sl’(11) or their related
commands would be the other part

good luck, this sounds like an interesting project. If you can, it
would be nice to see the resulting script of this (sanitized of IPs,
names, and such of course)

Andy Konecny
KonecnyConsulting.ca in Toronto

Andy’s Profiles: http://forums.novell.com/member.php?userid=75037
https://forums.suse.com/member.php?2959-konecnya

I created this script …it can give an aprox idea of it …

#! /bin/sh

credit to a very good friend of mine, Joao Faria, i m not any good on scripting …

can also use this …

#GUID=$(grep guid /root/.suse_register.log | grep register | grep processor| head -n 1 | sed ‘s/^.//g’ | sed 's/<\/guid.$//g’)

#but I opted for this one, since only exists after running ‘suse_register’ …

if [ ! -f /var/cache/SuseRegister/lastzmdconfig.cache ];
then
echo “Not Active!!”
else
GUID=$(grep guid /var/cache/SuseRegister/lastzmdconfig.cache | grep zmdconfig | grep catalog | grep success |grep OK | head -n 1 | sed ‘s/^.//g’ | sed 's/<\/guid.$//g’)
if [ -z “${GUID//[a-z0-9]}” ]; then
echo “Activated!!”
else
echo “Not Active!!”
fi
fi

Hope this can help others …
JG

In article jg_cnenet.5mr7cn@no-mx.forums.suse.com, Jg cnenet wrote:[color=blue]

I created this script …it can give an aprox idea of it …
[/color]
An interesting way of doing it. I hadn’t looked into
lastzmdconfig.cache before and will be looking at it closer.
My worry is that it might not catch all conditions as that file isn’t
updated all that frequently, I have at least one box that it hasn’t
been refreshed in over a month.

I guess that will make a good weekly or monthly scan check that will
catch a bunch of the broken or incomplete registrations as well as an
on demand test.

Thank you for sharing.

Andy Konecny
KonecnyConsulting.ca in Toronto

Andy’s Profiles: http://forums.novell.com/member.php?userid=75037
https://forums.suse.com/member.php?2959-konecnya