# Command Line to verify registration and patch management

**URL:** <https://forums.suse.com/t/command-line-to-verify-registration-and-patch-management/23354>\
**Category:** SLES Configure-Administer\
**Created:** [November 28, 2012, 6:47pm UTC](https://forums.suse.com/t/command-line-to-verify-registration-and-patch-management/23354 "2012-11-28T18:47:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jg\_cnenet](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@jg\_cnenet](https://forums.suse.com/u/jg_cnenet)\
**Post date:** [November 28, 2012, 6:47pm UTC](https://forums.suse.com/t/command-line-to-verify-registration-and-patch-management/23354/1 "2012-11-28T18:47:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![konecnya](https://avatars.discourse-cdn.com/v4/letter/k/ee7513/32.png) [@konecnya](https://forums.suse.com/u/konecnya)\
**Post date:** [November 28, 2012, 8:12pm UTC](https://forums.suse.com/t/command-line-to-verify-registration-and-patch-management/23354/2 "2012-11-28T20:12:18Z")

</div>

In article [jg\_cnenet.5mr1bz@no-mx.forums.suse.com](mailto: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](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](http://forums.novell.com/member.php?userid=75037)  
[https://forums.suse.com/member.php?2959-konecnya](https://forums.suse.com/member.php?2959-konecnya)

---

<div class="post-metadata">

**Author:** ![jg\_cnenet](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@jg\_cnenet](https://forums.suse.com/u/jg_cnenet)\
**Post date:** [November 28, 2012, 8:58pm UTC](https://forums.suse.com/t/command-line-to-verify-registration-and-patch-management/23354/3 "2012-11-28T20:58:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![konecnya](https://avatars.discourse-cdn.com/v4/letter/k/ee7513/32.png) [@konecnya](https://forums.suse.com/u/konecnya)\
**Post date:** [November 28, 2012, 10:13pm UTC](https://forums.suse.com/t/command-line-to-verify-registration-and-patch-management/23354/4 "2012-11-28T22:13:44Z")

</div>

In article [jg\_cnenet.5mr7cn@no-mx.forums.suse.com](mailto: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](http://forums.novell.com/member.php?userid=75037)  
[https://forums.suse.com/member.php?2959-konecnya](https://forums.suse.com/member.php?2959-konecnya)
