tag:blogger.com,1999:blog-54721581368283124032024-03-05T11:38:04.609+01:00Blog of Hermann MaurerWelcome to my absolutely private Blog ;-)Anonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.comBlogger40125tag:blogger.com,1999:blog-5472158136828312403.post-56921180949756097452014-07-13T19:45:00.002+02:002014-07-13T19:45:38.890+02:00The last one hereIf you like to follow me, please visit my blog at <a href="http://hermannsspace.de/">http://hermannsspace.de/</a>Anonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.com0tag:blogger.com,1999:blog-5472158136828312403.post-37200794016953521802014-05-09T17:14:00.001+02:002014-05-09T17:14:28.551+02:00Accessing OMD unter CentOS and SelinuxIf you've got the error like this<br />
<br />
<h1>
OMD: Site Not Started</h1>
You need to start this site in order to access the web interface.<br />
<br />
<br />
in your fresh configured and <u>started</u> OMD site, Selinux can cause the issue. Consider to configure Selinux properly (have a lot of fun!) or disable it in /etc/syssconfig/selinux.Anonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.com4tag:blogger.com,1999:blog-5472158136828312403.post-70860034977309450942014-04-08T16:05:00.003+02:002014-04-08T16:08:58.476+02:00CentOS and Active Directory 2008<span style="font-family: Trebuchet MS, sans-serif;">This article is intended for those of you, who has read <a href="http://hermannmaurer.blogspot.com/2012/02/in-this-article-ill-show-you-how-to.html" target="_blank">my old post about CentOS and the integration into Microsoft Active Directory</a>. In my old post I referred to Microsoft Active Directory 2003. In cases, when you upgraded to MS AD 2008, you have to update some entries in configuration file /etc/nslcd.conf.</span><br />
<span style="font-family: 'Trebuchet MS', sans-serif;"></span><br />
<a name='more'></a>The background is the following:<br />
<span style="font-family: Trebuchet MS, sans-serif;"><br />
MS AD 2008 introduced new attributes that should replace old ones, comiing from MS SFU 3.0. The attributes coming from MS SFU 3.0 like msSFU30UidNumber or msSFU30LoginShell are still active for user and group objects that had been created before you upgraded AD from 2003 to 2008. After the upgrade all user and group objects will not get those attributes but some others. During the upgrade procedure values of the old attributes were copied to the new ones. Because of this copy procedure you can start using the new attributes just after the upgrade of AD to 2008. It's a good point to review and update the configuration file under CentOS. Of course you can continue using old configuration files keeping in mind that the configuration will not match new users and groups that will be created after the AD upgrade. </span><br />
<span style="font-family: Trebuchet MS, sans-serif;"><br />
Please look at the configuration file /etc/nslcd.conf below to</span><br />
<br />
<span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; margin: 0px; padding: 0px;"><i># Remove the comment char at the beginning of two lines below for</i></span><br />
<span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; margin: 0px; padding: 0px;"><i># debugging purposes</i></span><br />
<span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; margin: 0px; padding: 0px;"><i>#logdir /var/log</i></span><br />
<span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; margin: 0px; padding: 0px;"><i>#debug 1</i></span><br />
<span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; margin: 0px; padding: 0px;"><i># You can supply as many servers as you want, but only the </i></span><br />
<i><span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; margin: 0px; padding: 0px;"># first one </span><span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; margin: 0px; padding: 0px;">will be asked normally. If the first one doesn't </span></i><br />
<i><span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; margin: 0px; padding: 0px;"># answer, the next</span><span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; margin: 0px; padding: 0px;"> one will be asked and so on.</span></i><br />
<span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; margin: 0px; padding: 0px;"><i style="background-color: transparent;"># Additionally enable encryption between the DC and us</i></span><br />
<span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; margin: 0px; padding: 0px;"><i>uri ldaps://dc1.domain.com/</i></span><br />
<span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; margin: 0px; padding: 0px;"><i>uri ldaps://dc2.domain.com/</i></span><br />
<i style="color: #222222; font-family: 'Courier New', Courier, monospace;">ssl on</i><br />
<i style="color: #222222; font-family: 'Courier New', Courier, monospace;">tls_reqcert never</i><br />
<div>
<i style="color: #222222; font-family: 'Courier New', Courier, monospace;"># The base DN of your AD domain</i></div>
<span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; margin: 0px; padding: 0px;"><i>base dc=domain,dc=com</i></span><br />
<span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; margin: 0px; padding: 0px;"><i># The LDAP version to use</i></span><br />
<span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; margin: 0px; padding: 0px;"><i>ldap_version 3</i></span><br />
<span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; margin: 0px; padding: 0px;"><i># If you do not allow anonymous search in your AD domain, please set the right</i></span><br />
<span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; margin: 0px; padding: 0px;"><i># user name and password of a user account you'll use to search with.</i></span><br />
<span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; margin: 0px; padding: 0px;"><i>binddn domain.com\bind-user-dn</i></span><br />
<span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; margin: 0px; padding: 0px;"><i>bindpw bind-user-password</i></span><br />
<span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; margin: 0px; padding: 0px;"><i># It's safe to leave them untouched </i></span><br />
<span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; margin: 0px; padding: 0px;"><i>scope sub</i></span><br />
<span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; margin: 0px; padding: 0px;"><i>pagesize 1000</i></span><br />
<span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; margin: 0px; padding: 0px;"><i>referrals off</i></span><br />
<span style="font-family: Courier New, Courier, monospace;"><i><span style="background-color: white; color: #222222; margin: 0px; padding: 0px;"><br style="margin: 0px; padding: 0px;" /></span><span style="background-color: white; color: #222222;"></span><span style="background-color: white; color: #222222; margin: 0px; padding: 0px;"># The two lines below describes how it should be searched in AD for a user and for a group</span></i></span><br />
<span style="color: #222222; font-family: Courier New, Courier, monospace;"><i>filter passwd (&(objectCategory=user)(uidNumber=*)(memberOf=CN=mygroup,OU=Groups,DC=domain,DC=com))</i></span><br />
<span style="color: #222222; font-family: Courier New, Courier, monospace;"><i>filter group (&(objectCategory=group)(gidNumber=*))</i></span><br />
<div>
<span style="font-family: Courier New, Courier, monospace;"><i><br /></i></span></div>
<span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; margin: 0px; padding: 0px;"><i># The lines below describe the mapping of Posix attributes to their analogs in AD</i></span><br />
<span style="color: #222222; font-family: Courier New, Courier, monospace;"><i>map passwd uid sAMAccountName</i></span><br />
<span style="color: #222222; font-family: Courier New, Courier, monospace;"><i>map passwd homeDirectory unixHomeDirectory</i></span><br />
<span style="color: #222222; font-family: Courier New, Courier, monospace;"><i>map passwd gecos displayName</i></span><br />
<span style="color: #222222; font-family: 'Courier New', Courier, monospace;"><i>map group uniqueMember member</i></span><br />
<div>
<br /></div>
<span style="font-family: Trebuchet MS, sans-serif;">You can see, you need much less attributes to configure than earlier in AD 2003. </span><br />
<span style="background-color: white; color: #222222; font-family: Trebuchet MS, sans-serif;">After you've changed the configuration file, you have to re-start the service:</span><br />
<br style="background-color: white; color: #222222; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Helvetica, Arial, sans-serif; font-size: 13px; margin: 0px; padding: 0px;" />
<span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; margin: 0px; padding: 0px;"><i style="margin: 0px; padding: 0px;"># service nslcd start</i></span><br />
<br />Anonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.com0tag:blogger.com,1999:blog-5472158136828312403.post-10168631716539837892014-03-03T21:42:00.000+01:002014-03-03T21:42:23.990+01:00Yum's additional toolsI've learnt new helpful commands recently that belongs to yum tools (thank you <i>MLLR</i>). I'd like to say a few words about the usage of the commands<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">.</span><br />
<br />
<a name='more'></a><br />
<h3>
package-cleanup</h3>
Often you see that new kernels installed and installed again and free space on the boot partition decreases. The time comes to remove old kernel packages. You can remove each single kernel package, but there is the command package-cleanup for such goals:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">package-cleanup --oldkernels --count=2</span><br />
<br />
The command above removes old kernel packages and leaves not more than 2 ones.<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">package-cleanup --orphans</span><br />
<br />
The command above removes packages that are not managed by all configured repositories.<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">package-cleanup --problems</span><br />
<br />
The command above analyzes problems with for example package dependances and shows them, if any found.<br />
<br />
<h3>
show-installed</h3>
Sometimes it's very interesting, which package group and which additional packages are installed in the system. Use the command show-installed to do this. You'll get the output like this:<br />
<br />
show-installed<br />
WARNING: The following packages are installed but not in the repository:<br />
microsoft-hyper-v<br />
oracle-instantclient-devel<br />
oracle-instantclient-basic<br />
iwl6000g2b-firmware<br />
check_mk-agent<br />
kmod-microsoft-hyper-v<br />
VRTSralus<br />
<br />
@base<br />
-ledmon<br />
-scl-utils<br />
@core<br />
# Others<br />
VRTSralus<br />
autofs<br />
check_mk-agent<br />
epel-release<br />
gcc<br />
iwl6000g2b-firmware<br />
mc<br />
microsoft-hyper-v<br />
mod_ssl<br />
nss-pam-ldapd<br />
oracle-instantclient-devel<br />
php-devel<br />
php-domxml-php4-php5<br />
php-gd<br />
php-intl<br />
php-ldap<br />
php-mbstring<br />
php-soap<br />
php-xmlrpc<br />
re2c<br />
xfsprogs<br />
yum-cron<br />
# 454 package names, 123 leaves<br />
# 2 groups, 22 leftovers, 2 excludes<br />
# 30 lines<br />
<div>
<br /></div>
<br />Anonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.com0tag:blogger.com,1999:blog-5472158136828312403.post-47080185638584116002013-09-29T16:39:00.001+02:002014-04-18T13:18:56.671+02:00hermannmaurer's photostream<div style="margin: 0; overflow: hidden; padding: 0; width: 500px;">
<br /></div>
<div style="margin-bottom: 5px; margin-top: 0px;">
<a href="http://www.flickr.com/photos/101419012@N05/">hermannmaurer's photostream</a> on Flickr.</div>
My Flickr photostreamAnonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.com0tag:blogger.com,1999:blog-5472158136828312403.post-83639362899317115372013-09-24T19:37:00.001+02:002013-09-24T19:38:55.359+02:00In Berlin<div class="separator" style="clear: both; text-align: center;"> <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgh6VwAVSiogdudOeYqIEMSYEoRIif6PxfgvCMtlLCplr1tsFj8C1VoY_a4lHv7JfM0kmhegp4Az_J5n9D52yK0OeJ506BQQHPhs3TpxKSa4H_AulGWYSrBzrGVnC61YkwN4y31rlmnq54/s1600/OI000003.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"> <img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgh6VwAVSiogdudOeYqIEMSYEoRIif6PxfgvCMtlLCplr1tsFj8C1VoY_a4lHv7JfM0kmhegp4Az_J5n9D52yK0OeJ506BQQHPhs3TpxKSa4H_AulGWYSrBzrGVnC61YkwN4y31rlmnq54/s640/OI000003.jpg"> </a> </div>Anonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.com0tag:blogger.com,1999:blog-5472158136828312403.post-46516902264357078262013-08-21T18:04:00.000+02:002013-08-21T18:05:41.663+02:00Fortigate firewall check package for Check_MK updatedI've updated the package to the version 1.6. This version contains an additional check of IPSec tunnel status of a Fortigate firewall. It works for FGT-300C and FGT-60C units. Other models can work as well, but I could not test.<br />
<br />
You can download the new package at the known place from the <a href="http://exchange.check-mk.org/index.php?option=com_remository&Itemid=53&func=fileinfo&id=89" target="_blank">Check MK Exchange repository</a>.Anonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.com6tag:blogger.com,1999:blog-5472158136828312403.post-46400794217754453352013-05-15T18:08:00.000+02:002013-05-15T18:08:57.598+02:00Find parent path to a mail enabled public folderIn EMC of Exchange 2010 you can use the following command to show the parent path to a mail-enabled public folder:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">get-recipient
address@domain.com | Get-MailPublicFolder
| Get-PublicFolder</span><br />
<br />
<div style="font-size: 11pt; margin: 0in;">
<span style="font-family: Courier New, Courier, monospace;">Name Parent Path</span></div>
<div style="font-size: 11pt; margin: 0in;">
<span style="font-family: Courier New, Courier, monospace;">---- -----------</span></div>
<div style="font-size: 11pt; margin: 0in;">
<span style="font-family: Courier New, Courier, monospace;">address@domain.com \folder1\folder2</span></div>
Anonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.com2tag:blogger.com,1999:blog-5472158136828312403.post-11095214496053397322013-03-19T09:33:00.000+01:002013-03-19T09:34:33.001+01:00OMD fails to start after CentOS upgrade to 6.4I faced a problem starting OMD 0.54 after upgrading CentOS to the version 6.4. The start script returns a bunch of error messages:<br />
<br />
<br />
[root@omd ~]# omd restart mysite<br />
Doing 'restart' on site mysite:<br />
Creating temporary filesystem /omd/sites/mysite/tmp...mount: can't find /omd/sites/ mysite/tmp in /etc/fstab or /etc/mtab<br />
ERROR<br />
Removing Crontab...<br />
Stopping xinetd...OK<br />
Stopping icinga...Not running. OK<br />
npcd was not running... could not stop<br />
Stopping rrdcached...waiting for termination...OK<br />
Stopping dedicated Apache for site mysite....OK<br />
Starting dedicated Apache for site mysite...OK<br />
Starting rrdcached...OK<br />
Starting npcd...touch: cannot touch `/omd/sites/mysite/tmp/pnp4nagios/run/npcd.pid' : No such file or directory<br />
chown: cannot access `/omd/sites/mysite/tmp/pnp4nagios/run/npcd.pid': No such file or directory<br />
An Error occured while reading your config on line 197<br />
Message was: "Could not open pidfile '/omd/sites/mysite/tmp/pnp4nagios/run/npcd.pid ': No such file or directory"<br />
OK<br />
/omd/sites/mysite/etc/rc.d/80-icinga: line 54: /omd/sites/mysite/tmp/nagios/nagios.cfg : No such file or directory<br />
Icinga configuration file /omd/sites/mysite/tmp/nagios/nagios.cfg not found. Terminating...<br />
Starting xinetd...OK<br />
Initializing Crontab...OK<br />
<div>
<br /></div>
<div>
I found a couple of reports about the same problem. The root cause seems to be a bug (or a feature?) in the package util-linux-ng-2.17.2-12.9.el6.x86_64 that prevents non root users to mount partitions from /etc/fstab, whose path name conatains a symlink (symbolic link). In case of OMD /omd is a symlink pointing to /opt/omd.</div>
<div>
<br /></div>
<div>
A workaround that helped me to solve the problem was adding /opt to the appropriate path in /etc/fstab:</div>
<div>
<br /></div>
<div>
tmpfs <span style="color: orange;">/opt</span>/omd/sites/nysite/tmp tmpfs noauto,user,mode=755,uid=mysite,gid=mysite 0 0</div>
<br />Anonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.com0tag:blogger.com,1999:blog-5472158136828312403.post-64288807306222270942013-02-21T11:28:00.000+01:002013-02-21T11:28:01.347+01:00Check_MK check for Fortigate firewallsI've got a Fortigate 60C and wanted to monitor it in Check_MK. I could find a plugin written by Justin McMillen, but it didn't work in the version 1.1.2 of Check_MK. Also they seemed to use SNMP OIDs, which my Fortigate 60C didn't have. So I've updated his checks and created a new version of the plugin. The checks use SNMP to get CPU and RAM usage as ell as the session count. You can download the package from <a href="http://exchange.check-mk.org/index.php?option=com_remository&Itemid=59&func=fileinfo&id=89" target="_blank">Check_MK Exchange site</a>.Anonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.com3tag:blogger.com,1999:blog-5472158136828312403.post-3415399489268806352013-02-21T10:51:00.001+01:002013-02-21T10:51:05.576+01:00Version 1.3.2 of Ex2010_MBDB_Info released<br />
Again I've released a new version of the check. I've changed only the Windows plugin. Now the spaces in a mailbox database name are replaced by underscores. I hope this change would help all of you, who experienced problems with the plugin.<br />
<br />
To update it's enough to download the new check package, install it in your check_mk instance by a command like this:<br />
<br />
cmk -vP install Ex2010_MBDB_Info-1.3.2.mkp<br />
<br />
and substitute the cmd file on your Exchange server by the Ex2010_MBDB_Info.ps1 file from the new package.<br />
<br />
You can find the new version of the package at the known place at the <a href="http://exchange.check-mk.org/index.php?option=com_remository&Itemid=53&func=fileinfo&id=75" target="_blank">check_mk plugin exchange site</a>.<br />
Anonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.com5tag:blogger.com,1999:blog-5472158136828312403.post-62127683812231143032013-01-30T10:32:00.002+01:002013-01-30T17:47:47.342+01:00Version 1.3.1 of Ex2010_MBDB_Info releasedI've released a new version of the check. I've changed the Windows plugin. It is now a pure Powershell script, not a command script anymore. It should run smoothly to avoid problems, which some of you had in the past running the plugin.<br />
To update it's enough to download the new check package, install it in your check_mk instance by a command like this:<br />
<br />
cmk -vP install Ex2010_MBDB_Info-1.3.1.mkp<br />
<br />
and substitute the cmd file on your Exchange server by the Ex2010_MBDB_Info.ps1 file from the new package.<br />
<br />
You can find the new version of the package at the known place at the <a href="http://exchange.check-mk.org/index.php?option=com_remository&Itemid=53&func=fileinfo&id=75" target="_blank">check_mk plugin exchange site</a>.Anonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.com14tag:blogger.com,1999:blog-5472158136828312403.post-63906108700060165302012-12-05T16:34:00.000+01:002012-12-07T01:06:51.702+01:00Upgrade Microsoft Hyper-V Linux IC from 3.3 to 3.4Recently I had to upgrade the integration components on a lot of CentOS virtual systems running on a Hyper-V failover cluster. During the upgrade procedure I faced a couple of things, which I'd like you to be aware of. The version on the guest VM is CentOS 6.3, the Hyper-V failover cluster is running under Windows Server 2008 R2 SP1 and consists of 6 nodes.<br />
<br />
Below is the output of LVM related commands before starting the upgrade of Linux IC:<br />
<span style="font-family: 'Courier New', Courier, monospace;"></span><br />
<a name='more'></a><span style="font-family: 'Courier New', Courier, monospace;">[root@CentOS ~]# </span><u style="font-family: 'Courier New', Courier, monospace;">pvs</u><br />
<span style="font-family: Courier New, Courier, monospace;"> PV VG Fmt Attr PSize PFree</span><br />
<span style="font-family: Courier New, Courier, monospace;"> /dev/sda2 system lvm2 a-- 9.50g 4.25g</span><br />
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@CentOS ~]# <u>vgs</u></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> VG #PV #LV #SN Attr VSize VFree</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> system 1 7 0 wz--n- 9.50g 4.25g</span></div>
</div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@CentOS ~]# <u>lvs</u></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> home system -wi-ao-- 256.00m</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> opt system -wi-ao-- 256.00m</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> root system -wi-ao-- 1.00g</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> swap system -wi-ao-- 1.00g</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> tmp system -wi-ao-- 256.00m</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> usr system -wi-ao-- 2.00g</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> var system -wi-ao-- 512.00m</span></div>
</div>
<div>
<br /></div>
First of all I removed the old kernel packages, because the installation scripts provided by Hyper-V Linux IC packages re-build the initrd for each kernel they found in the system. The removing of old kernels saves time.<br />
<div>
<br />
<span style="font-family: Courier New, Courier, monospace;">[root@CentOS ~]# <u>rpm -q kernel</u></span><br />
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">kernel-2.6.32-279.2.1.el6.x86_64</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">kernel-2.6.32-279.5.1.el6.x86_64</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">kernel-2.6.32-279.5.2.el6.x86_64</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">kernel-2.6.32-279.9.1.el6.x86_64</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">kernel-2.6.32-279.11.1.el6.x86_64</span></div>
<div>
<br />
I had to find out the version of the running kernel, because its package cannot be removed:<br />
<span style="font-family: Courier New, Courier, monospace;">[root@CentOS ~]# <u>uname -a</u></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Linux CentOS 2.6.32-279.11.1.el6.x86_64 #1 SMP Tue Oct 16 15:57:10 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux</span></div>
</div>
<div>
<br />
Then removed the old kernel packages:<br />
<span style="font-family: Courier New, Courier, monospace;">[root@CentOS ~]# <u>yum remove kernel-2.6.32-279.2.1.el6.x86_64 kernel-2.6.32-279.5.1.el6.x86_64 kernel-2.6.32-279.5.2.el6.x86_64 kernel-2.6.32-279.9.1.el6.x86_64</u></span></div>
<div>
<div>
<br />
At this point there was only one kernel package installed:<br />
<span style="font-family: Courier New, Courier, monospace;">[root@CentOS ~]# <u>rpm -q kernel</u></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">kernel-2.6.32-279.11.1.el6.x86_64</span></div>
<div>
<br /></div>
</div>
<div>
So let's upgrade the Linux Integration Components to the new version:</div>
<span style="font-family: Courier New, Courier, monospace;">[root@CentOS ~]# <u>mount -o loop /tmp/LinuxICv34.iso /mnt</u></span><br />
<span style="font-family: Courier New, Courier, monospace;">[root@CentOS ~]# <u>cd /mnt/RHEL63/</u></span><br />
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@CentOS RHEL63]# <u>./upgrade.sh</u></span></div>
</div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Upgrading the Linux Integration Services for Microsoft Hyper-V...</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Preparing... ########################################### [100%]</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> 1:kmod-microsoft-hyper-v ########################################### [ 50%]</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> 2:microsoft-hyper-v ########################################### [100%]</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Saving old initramfs</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Installing new initramfs</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> Linux Integration Services for Hyper-V has been Upgraded. Please reboot your system</span></div>
</div>
<div>
<br /></div>
<div>
After reboot:</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@CentOS ~]# <u>rpm -qa | grep hyper-v</u></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">microsoft-hyper-v-rhel63.3.4-1.20120727.x86_64</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">kmod-microsoft-hyper-v-rhel63.3.4-1.20120727.x86_64</span></div>
</div>
<div>
<br />
But somehow the hdd driver found disks and partitions twice:</div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@CentOS ~]# <u>pvs</u></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> Found duplicate PV T6aUTmcAaWK29Sa3EQTZeztnNqYJu5Kv: using /dev/sdb2 not /dev/sda2</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> PV VG Fmt Attr PSize PFree</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> /dev/sdb2 system lvm2 a-- 9.50g 4.25g</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@CentOS ~]# <u>vgs</u></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> Found duplicate PV T6aUTmcAaWK29Sa3EQTZeztnNqYJu5Kv: using /dev/sdb2 not /dev/sda2</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> VG #PV #LV #SN Attr VSize VFree</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> system 1 7 0 wz--n- 9.50g 4.25g</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@CentOS ~]# <u>lvs</u></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> Found duplicate PV T6aUTmcAaWK29Sa3EQTZeztnNqYJu5Kv: using /dev/sdb2 not /dev/sda2</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> home system -wi-ao-- 256.00m</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> opt system -wi-ao-- 256.00m</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> root system -wi-ao-- 1.00g</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> swap system -wi-ao-- 1.00g</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> tmp system -wi-ao-- 256.00m</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> usr system -wi-ao-- 2.00g</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> var system -wi-ao-- 512.00m</span></div>
</div>
<div>
<br /></div>
<div>
The CentOS VM ran without any obvious problems, but I wanted to get rid of the issue. The solution was to re-install the packages.</div>
<br />
The first step is to remove Linux IC packages, because the script form the Linux IC installation ISO didn't permit the re-installation or the upgrade, when it found the installed packages:<br />
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@CentOS ~]# <u>mount -o loop /tmp/LinuxICv34.iso /mnt</u> </span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@CentOS ~]# <u>cd /mnt/RHEL63/</u></span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;">[root@CentOS RHEL63]# <u>./install.sh</u></span></div>
</div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Installing the Linux Integration Services for Microsoft Hyper-V...</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Preparing... ########################################### [100%]</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> package kmod-microsoft-hyper-v-rhel63.3.4-1.20120727.x86_64 is already installed</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Kmod RPM installation failed, Exiting.</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@CentOS RHEL63]# <u>./upgrade.sh</u></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Upgrading the Linux Integration Services for Microsoft Hyper-V...</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Preparing... ########################################### [100%]</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> package kmod-microsoft-hyper-v-rhel63.3.4-1.20120727.x86_64 is already installed</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> package microsoft-hyper-v-rhel63.3.4-1.20120727.x86_64 is already installed</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Microsoft-Hyper-V rpm Upgradation failed, Exiting</span></div>
</div>
<div>
<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@CentOS RHEL63]# <u>yum -yq remove microsoft-hyper-v-rhel63.3.4-1.20120727.x86_64 kmod-microsoft-hyper-v-rhel63.3.4-1.20120727.x86_64</u></span></div>
</div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">================================================================================</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> Package Arch Version Repository Size</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">================================================================================</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Removing:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> kmod-microsoft-hyper-v x86_64 rhel63.3.4-1.20120727 installed 4.3 M</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> microsoft-hyper-v x86_64 rhel63.3.4-1.20120727 installed 16 k</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Transaction Summary</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">================================================================================</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Remove 2 Package(s)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Create and install initramfs without Hyper-V drivers</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Linux Integration Services for Hyper-V has been removed. Please reboot your system.</span></div>
</div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: inherit;">After the removing of packages I started the install procedure:</span></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@CentOS RHEL63]# <u>./install.sh</u> </span><br />
<span style="font-family: Courier New, Courier, monospace;">Installing the Linux Integration Services for Microsoft Hyper-V...</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Preparing... ########################################### [100%]</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> 1:kmod-microsoft-hyper-v ########################################### [100%]</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Preparing... ########################################### [100%]</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> 1:microsoft-hyper-v ########################################### [100%]</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Saving old initramfs</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Installing new initramfs</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> Linux Integration Services for Hyper-V has been installed. Please reboot your system.</span></div>
</div>
<div>
<br />
and re-started the VM after that:</div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@CentOS RHEL63]# <u>reboot</u></span></div>
<div>
<br />
After the re-installation of the packages with a reboot the disks and partitions were detected the correct way: </div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@CentOS ~]# <u>pvs</u></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> PV VG Fmt Attr PSize PFree</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> /dev/sda2 system lvm2 a-- 9.50g 4.25g</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@CentOS ~]# <u>vgs</u></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> VG #PV #LV #SN Attr VSize VFree</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> system 1 7 0 wz--n- 9.50g 4.25g</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@CentOS ~]# <u>lvs</u></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> home system -wi-ao-- 256.00m</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> opt system -wi-ao-- 256.00m</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> root system -wi-ao-- 1.00g</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> swap system -wi-ao-- 1.00g</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> tmp system -wi-ao-- 256.00m</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> usr system -wi-ao-- 2.00g</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> var system -wi-ao-- 512.00m</span></div>
</div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@CentOS ~]# <u>rpm -q kernel</u></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">kernel-2.6.32-279.11.1.el6.x86_64</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@CentOS ~]# <u>rpm -qa | grep hyper-v</u> </span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">kmod-microsoft-hyper-v-rhel63.3.4-1.20120727.x86_64</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">microsoft-hyper-v-rhel63.3.4-1.20120727.x86_64</span></div>
</div>
<div>
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.com5tag:blogger.com,1999:blog-5472158136828312403.post-18075262430482697882012-12-05T11:05:00.000+01:002012-12-05T11:07:45.689+01:00Find differences in Public Folder replicasThis is a small piece of code to run it in EMS and to help you finding differences in item number in a public folder structure. The powershell script shows the number of elements in each sub folder for the both of Exchange 2010 servers, which public folder replicas are located on. Below is an example output of the script.<br />
<br />
<br />
[PS] C:\>C:\scripts\get-pffolderdiffs.ps1<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Path ItemCount_SRV1 ItemCount_SRV2</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">---- -------------- --------------</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">\PF1\VPC 0 0</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">\PF1\VPC\Exec 1739 1739</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">\PF1\VPC\Exec\2007 20406 20406</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">\PF1\VPC\Exec\2008 21952 21952</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">\PF1\VPC\Exec\2009 27804 27804</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">\PF1\VPC\Exec\2010 16888 16888</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">\PF1\VPC\Exec\2011 39021 1869</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">\PF1\VPC\Exec\2012 15734 15734</span><br />
<br />
Please note that the script is provided AS IS without any guarantee:<br />
<br />
<br />
$PF='\PF1'<br />
$SR1='SRV1'<br />
$SR2='SRV2'<br />
<br />
<br />
Get-PublicFolder -Server $SR1 -ResultSize unlimited -Identity $PF -Recurse `<br />
| Sort-Object -Property @{expression={$_.ParentPath + '\' + $_.Name}} |<br />
ft @{label="Path"; expression={ $_.ParentPath + "\" + $_.Name }},<br />
@{label="ItemCount_$SR1"; expression={ `<br />
(get-PublicFolderStatistics -Server $SR1 ($_.ParentPath + '\' + $_.Name) `<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> | Select-Object -ExpandProperty ItemCount) }}, `<br />
@{label="ItemCount_$SR2"; expression={ `<br />
(get-PublicFolderStatistics -Server $SR2 ($_.ParentPath + '\' + $_.Name) `<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> | Select-Object -ExpandProperty ItemCount) }} -auto<br />
<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.com0tag:blogger.com,1999:blog-5472158136828312403.post-84125111291650847722012-09-26T23:53:00.001+02:002012-09-26T23:53:15.343+02:00Check_MK check to show some data about Ex2010 mailbox databasesA few days ago I finished to test a new check for check_mk and published it as package at <a href="http://exchange.check-mk.org/index.php?option=com_remository&Itemid=53&func=fileinfo&id=75" target="_blank">Check_MK Exchange</a>. I named the check "Ex2010_MBDB_Info". In this article I'd like to share a couple of details about the check and its functionality.<br />
<br />
The purpose of the check is to get the size of mailbox databases and the count of the mailboxes in each of them. The check package consists of the check itself, the plugin for check_mk agent, the perf-o-meter helper file and the pnp-template.<br />
<br />
<a name='more'></a>The plugin It must run on an Exchange 2010 server that the role Mailbox server is installed and running on. The plugin is a cmd file, which calls some Powershell commands, which try to collect information from local (!) server about the size of the mailbox databases, which are located on the same server, and about the count of the mailboxes, which belong to the mailbox databases.<br />
The plugin for the check_mk agent must be copied in the sub-directory "plugins" of the installed check_mk agent, typically under c:\programm files(x86)\check_mk\plugins.<br />
<br />
The check itself has the ability to find all mailbox databases, which reside on the server with the copied plugin, while you carry out an inventory of the Exchange 2010 mailbox database server. The check creates a new service for each mailbox database found. The check's status is 'OK' always and the output is the size of the mailbox database (in MBytes or GBytes) and the count of the mailboxes, which reside in the mailbox database.<br />
<br />
Additionally a perf-o-meter and a PNP-template belong to the check. They help you to visualize the data collected during a longer time period and to recognize trends.<br />
<br />
Below is an example screenshot of the check in the check_mk interface:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqlBgQ6EvvOM3oSn3Seu-qxEmKcbQI6AJpdeq_lJ3RZ5PYCgkQ7VPkzqbEV-U2JS6GYtb9XPWdZui-5IxtcL4NvIUQNK-yNg26xmzFAlpzalcsiR2yItmeOSZBqiFLpQpbNqYHqzLtSXU/s1600/2012-09-26+23_42_06-hnmr@adminfra+-+adminfra.gft.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="100" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqlBgQ6EvvOM3oSn3Seu-qxEmKcbQI6AJpdeq_lJ3RZ5PYCgkQ7VPkzqbEV-U2JS6GYtb9XPWdZui-5IxtcL4NvIUQNK-yNg26xmzFAlpzalcsiR2yItmeOSZBqiFLpQpbNqYHqzLtSXU/s640/2012-09-26+23_42_06-hnmr@adminfra+-+adminfra.gft.png" width="640" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.com20tag:blogger.com,1999:blog-5472158136828312403.post-47584817685710741492012-08-01T18:32:00.000+02:002012-08-06T12:26:37.438+02:00Extending a LVM partition in a Hyper-V guest VM running CentOSImagine a scenario like the following: you have a Hyper-V host and a CentOS 6.3 guest. The CentOS guest has Microsoft Integration Services for Linux 3.3 installed and running. A data file system on the guest is running out of the free space:<br />
<br />
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@myhost ~]# <u><b>df -h /data/svn/</b></u></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Filesystem Size Used Avail Use% Mounted on</span></div>
</div>
<div>
<span style="font-family: Courier New, Courier, monospace;">/dev/mapper/data-svn 99G 93G 964M 99% /data/svn</span></div>
<br />
<br />
Although the partition is a part of LVM, but your entire disk is almost full. In the article I'd like to show how you can get rid of this without getting your services offline.<br />
<br />
<a name='more'></a>As first a new HDD must be created on the Hyper-V host side. For data HDDs I prefer to create SCSI HDDs. To get it calm for a while, I'm creating a 128GByte HDD of the type fixed:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1tEpoXpvGQLYJu-zojyKV9fnrGinT7O8vitYJSAkoPWd9vnA1m13YSAU65sP3oSeIerzfk5u43zrhlXujrZsN4tSpKbD4_AR4ZcwygFNrtZ7S6VDgCnbMFycJbbRYAwWIaQqfWZBaZEQ/s1600/2012-08-01+18_33_15-mRemoteNG+-+confCons.xml.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1tEpoXpvGQLYJu-zojyKV9fnrGinT7O8vitYJSAkoPWd9vnA1m13YSAU65sP3oSeIerzfk5u43zrhlXujrZsN4tSpKbD4_AR4ZcwygFNrtZ7S6VDgCnbMFycJbbRYAwWIaQqfWZBaZEQ/s400/2012-08-01+18_33_15-mRemoteNG+-+confCons.xml.png" width="378" /></a></div>
<br />
After the new HDD is created, it is visible to the guest and can be partitioned immediately:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><b>[root@myhost ~]# <u>tail /varlog/messages</u></b></span><br />
<span style="font-family: 'Courier New', Courier, monospace;">Aug 1 17:49:04 myhost kernel: scsi 1:0:0:1: Direct-Access Msft Virtual Disk 1.0 PQ: 0 ANSI: 4</span><br />
<span style="font-family: Courier New, Courier, monospace;">Aug 1 17:49:04 myhost kernel: sd 1:0:0:1: Attached scsi generic sg2 type 0</span><br />
<span style="font-family: Courier New, Courier, monospace;">Aug 1 17:49:04 myhost kernel: sd 1:0:0:1: [sdc] 268435456 512-byte logical blocks: (137 GB/128 GiB)</span><br />
<span style="font-family: Courier New, Courier, monospace;">Aug 1 17:49:04 myhost kernel: sd 1:0:0:1: [sdc] Write Protect is off</span><br />
<span style="font-family: Courier New, Courier, monospace;">Aug 1 17:49:04 myhost kernel: sd 1:0:0:1: [sdc] Write cache: enabled, read cache: enabled, supports DPO and FUA</span><br />
<span style="font-family: Courier New, Courier, monospace;">Aug 1 17:49:04 myhost kernel: sdc: unknown partition table</span><br />
<span style="font-family: Courier New, Courier, monospace;">Aug 1 17:49:04 myhost kernel: sd 1:0:0:1: [sdc] Attached SCSI disk</span><br />
<div>
<br /></div>
<div>
Create a new partition on the new disk according your needs but set the partition type to 8e (Linux LVM):</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@myhost ~]# <b><u>fdisk /dev/sdc</u></b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Building a new DOS disklabel with disk identifier 0xa05e1ec8.</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Changes will remain in memory only, until you decide to write them.</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">After that, of course, the previous content won't be recoverable.</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">WARNING: DOS-compatible mode is deprecated. It's strongly recommended to </span><span style="font-family: Courier New, Courier, monospace;">switch off the mode (command 'c') and change display units to </span><span style="font-family: 'Courier New', Courier, monospace;">sectors (command 'u').</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Command (m for help): <b><u>u</u></b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Changing display/entry units to sectors</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Command (m for help): <b><u>c</u></b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">DOS Compatibility flag is not set</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Command (m for help): <b><u>n</u></b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Command action</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> e extended</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> p primary partition (1-4)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><b><u>p</u></b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Partition number (1-4): <b><u>1</u></b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">First sector (2048-268435455, default 2048):<b><u>ENTER</u></b></span><b style="font-family: 'Courier New', Courier, monospace;"><u><enter></enter></u></b></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Using default value 2048</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Last sector, +sectors or +size{K,M,G} (2048-268435455, default 268435455):<b><u><enter></enter></u></b></span><b style="font-family: 'Courier New', Courier, monospace;"><u>ENTER</u></b></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Using default value 268435455</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Command (m for help): <b><u>p</u></b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Disk /dev/sdc: 137.4 GB, 137438953472 bytes</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">255 heads, 63 sectors/track, 16709 cylinders, total 268435456 sectors</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Units = sectors of 1 * 512 = 512 bytes</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Sector size (logical/physical): 512 bytes / 512 bytes</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">I/O size (minimum/optimal): 512 bytes / 512 bytes</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Disk identifier: 0xa05e1ec8</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> Device Boot Start End Blocks Id System</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">/dev/sdc1 2048 268435455 134216704 83 Linux</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Command (m for help): <b><u>t</u></b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Selected partition 1</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Hex code (type L to list codes): 8e</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Changed system type of partition 1 to 8e (Linux LVM)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Command (m for help): <b><u>wq</u></b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">The partition table has been altered!</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Calling ioctl() to re-read partition table.</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Syncing disks.</span></div>
</div>
<div>
<br /></div>
<div>
After the new partition has been created, a new physical volume must be created:</div>
<div>
<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@myhost ~]# <b><u>pvs</u></b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> PV VG Fmt Attr PSize PFree</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> /dev/sda2 system lvm2 a-- 9.50g 4.25g</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> /dev/sdb1 data lvm2 a-- 128.00g 8.00g</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@myhost ~]# <b><u>pvcreate /dev/sdc1</u></b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> Writing physical volume data to disk "/dev/sdc1"</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> Physical volume "/dev/sdc1" successfully created</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@myhost ~]# <b><u>pvs</u></b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> PV VG Fmt Attr PSize PFree</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> /dev/sda2 system lvm2 a-- 9.50g 4.25g</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> /dev/sdb1 data lvm2 a-- 128.00g 8.00g</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> /dev/sdc1 lvm2 a-- 128.00g 128.00g</span></div>
</div>
<div>
<br /></div>
<div>
As you can see at this step the new physical volume is known to the kernel.</div>
<div>
Now it's time to extend the volume group, which the concerned partition with low free space belongs to:</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@myhost ~]# <b><u>vgextend data /dev/sdc1</u></b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> Volume group "data" successfully extended</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@myhost ~]# <b><u>vgs</u></b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> VG #PV #LV #SN Attr VSize VFree</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> data 2 3 0 wz--n- 255.99g 135.99g</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> system 1 7 0 wz--n- 9.50g 4.25g</span></div>
</div>
<div>
<br /></div>
<div>
At this point the volume group 'data' has been extended. Now the logical volume, which concerned partition is located on, must be extended:</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@myhost ~]# <b><u>lvextend -L +10G /dev/data/svn</u></b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> Extending logical volume svn to 110.00 GiB</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> Logical volume svn successfully resized</span></div>
<div>
<br /></div>
<div>
After this has been done the file system must be extended (I have a ext4 file system here, but it should for any other file systems, that support LVM, the same way):</div>
<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@myhost ~]# <b><u>resize2fs /dev/data/svn</u></b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">resize2fs 1.41.12 (17-May-2010)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Filesystem at /dev/data/svn is mounted on /data/svn; on-line resizing required</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">old desc_blocks = 7, new_desc_blocks = 7</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Performing an on-line resize of /dev/data/svn to 28835840 (4k) blocks.</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">The filesystem on /dev/data/svn is now 28835840 blocks long.</span></div>
</div>
<div>
<br /></div>
<div>
And voila! The file system has some free space again and you can go home ;-)</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">[root@myhost ~]# <b><u>df -h /data/svn/</u></b></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Filesystem Size Used Avail Use% Mounted on</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">/dev/mapper/data-svn 109G 92G 12G 89% /data/svn</span></div>
</div>
<div>
<br /></div>Anonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.com0tag:blogger.com,1999:blog-5472158136828312403.post-67436385640469760262012-06-07T22:59:00.002+02:002012-09-13T12:15:09.367+02:00Lock and unlock an ActiveSync deviceAssume, a mobile phone or tablet device with a buggy implementation of the ActiveSync protocol causes a lot of traffic or a heavy load in your Exchange 2010 infrastructure (see this article of mine for an example). You surely could disable the ActiveSync feature for the Mailbox user to disable the access for the user completely. A better way is however to disable only the device, which causes the troubles. <br />
<br />
Exchange management shell offers cmdlets to manage ActiveSync devices:<br />
<br />
<a name='more'></a><br />
<br />
<div>
To see all ActiveSync devices that are connected (or have ever been connected) to the mailbox user use the following command: <br />
<br />
<span style="font-family: 'Courier New', Courier, monospace;">Get-ActiveSyncDevice -Mailbox <b>Mailbox<mailbox></mailbox></b> <usermailbox>| fl *device*
<br /> …………<br />DeviceId : <b><span style="color: red;">HTC14b71389864f33d5f4ea6dc1dbb4f</span></b><br />DeviceImei :<br />DeviceMobileOperator :<br />DeviceOS : Android 2.3.3<br />DeviceOSLanguage :<br />DeviceTelephoneNumber :<br />DeviceType : htcbravo<br />DeviceUserAgent : Android-EAS/3.10.000.083346.405<br />DeviceModel : htcbravo<br />DeviceAccessState : Allowed<br />DeviceAccessStateReason : Global<br />DeviceAccessControlRule :<br />DeviceActiveSyncVersion : 12.1<br />…………</usermailbox></span> <br />
The parameter "DeviceId" contains a string, which is to be used in the next command. Use this command below to lock the device with DeviceID for the Mailbox:<br />
<br />
<span style="font-family: 'Courier New', Courier, monospace;">Set-CASMailbox <b>Mailbox<mailbox></mailbox></b> <usermailbox>-ActiveSyncBlockedDeviceIDs <b><span style="color: red;">HTC14b71389864f33d5f4ea6dc1dbb4f</span></b></usermailbox></span><br />
<br />
To verify the result re-run the first command:</div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;">Get-ActiveSyncDevice -Mailbox <b>Mailbox</b></span><b style="font-family: 'Courier New', Courier, monospace;"><mailbox> </mailbox></b><span style="font-family: 'Courier New', Courier, monospace;">| fl *device*</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><usermailbox>…………</usermailbox></span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;">DeviceId : </span>
<b style="font-family: 'Courier New', Courier, monospace;"><span style="color: red;">HTC14b71389864f33d5f4ea6dc1dbb4f</span></b> <span style="font-family: 'Courier New', Courier, monospace;"><br />DeviceImei :<br />DeviceMobileOperator :<br />DeviceOS : Android 2.3.3<br />DeviceOSLanguage :<br />DeviceTelephoneNumber :<br />DeviceType : htcbravo<br />DeviceUserAgent : Android-EAS/3.10.000.083346.405<br />DeviceModel : htcbravo<br />DeviceAccessState : Blocked<br />DeviceAccessStateReason : Global<br />DeviceAccessControlRule :<br />DeviceActiveSyncVersion : 12.1<br />…………</span><br />
<br />
Also the blocked DeviceId appears in the list of the blocked device IDs for the mailbox:<br />
<br />
<span style="font-family: 'Courier New', Courier, monospace;">Get-CASMailbox <b>Mailbox </b></span><span style="font-family: 'Courier New', Courier, monospace;">| fl ActiveSync*</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><usermailbox>…………<br />ActiveSyncAllowedDeviceIDs : {}<br />ActiveSyncBlockedDeviceIDs : { </usermailbox></span>
<b style="font-family: 'Courier New', Courier, monospace;"><span style="color: red;">HTC14b71389864f33d5f4ea6dc1dbb4f</span></b> <span style="font-family: 'Courier New', Courier, monospace;"><usermailbox>}<br />ActiveSyncMailboxPolicy : Default<br />ActiveSyncMailboxPolicyIsDefaulted : True<br />………</usermailbox></span><br />
<br />
The next try to access the mailbox with the blocked device will fail and the user will receive an e-mail from the Exchange server that will notify the user about the locked device.<br />
<br />
To reset the blocked device list for a user mailbox enter the following command:<br />
<br />
<span style="font-family: 'Courier New', Courier, monospace;">Set-CASMailbox M</span><b style="font-family: 'Courier New', Courier, monospace;">ailbox</b><b style="font-family: 'Courier New', Courier, monospace;"><mailbox> </mailbox></b><span style="font-family: 'Courier New', Courier, monospace;">-ActiveSyncBlockedDeviceIDs $nul</span></div>
<div>
The command above allows all devices for a user mailbox.</div>
Anonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.com3tag:blogger.com,1999:blog-5472158136828312403.post-42940124250110054272012-05-18T15:37:00.000+02:002012-06-07T22:59:31.350+02:00Exchange 2010 transaction logfiles grow very fastA few days ago I had a problem with transaction log files on a Exchange 2010 SP2 RU1 mail server. They grown and grown and grown... I saw above 160,000 (one hundred sixty thousand !!!) files belonging to a single mailbox database. The mailbox database itself was ca. 30 GByte in size. It was then no surprise that the appropriate volume exceeded it capacity after only a couple of hours.<br />
<br />
I wouldn't even have noticed the issue but the appropriate backup job that should flush transaction log files among other things failed and didn't run. Because of the failed backup job the transaction log files were not flashed and were not removed but grown.<br />
<a name='more'></a><br />
But what was the reason log files grown such extremely way? I held as first spam emails or wrong-configured inbox rules responsible for the rapid growth. But I could see very soon that the amount of emails in the mailbox database increased very slowly. And sometimes I saw three thousand transaction log files were generated during 15 minutes. You may remember that one transaction log file's size is one MByte by default. Somebody wrote that an iPhone device caused the trouble like this. I had to find the device, which caused the issue, because of buggy Exchange ActriveSync protocol implementation.<br />
<br />
I used the following tools that helped me investigating the case and founding the real problem source:<br />
<br />
- LPS (Log Parser Studio)<br />
and<br />
- ExMon (Exchange User Monitor)<br />
<br />
The first one analyzes different log files (IIS log files from the responsible CAS server in this case) and can create statistics based on the analyses. It requires "Log Parser 2.2" to be installed. The pre-defined queries are very good, I used "ActiveSync Report [Top 20]" to find the device that caused the traffic and the creation of the transaction log files:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPTEwObUZhygZ71iYpamPIaZ7MhVVEPH2L-SeK68pU2ClpqmGe48bUxbQOSnyoQvdz9bqOO5SLRIAL279cEKHdupVszy4XuguJTnkmvjWMGtWDfonEBfSAWRoTKCv4EJ781ghmkzofzwM/s1600/2012-05-16+09-17-27_000122.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img alt="Log Parser Studio statistics " border="0" height="244" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPTEwObUZhygZ71iYpamPIaZ7MhVVEPH2L-SeK68pU2ClpqmGe48bUxbQOSnyoQvdz9bqOO5SLRIAL279cEKHdupVszy4XuguJTnkmvjWMGtWDfonEBfSAWRoTKCv4EJ781ghmkzofzwM/s640/2012-05-16+09-17-27_000122.png" title="Log Parser Studio statistics " width="640" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
The very big amount of Hits and Pings in the first line of the statistics indicates that the device causes a problem.<br />
<br />
The second helpful tool comes from world of Exchange 5.5 and 2003, but it runs under Exchange 2010 as well. It died showing an exception, but it was no big thing. I had to run it as administrator. ExMon shows a very detailed statistics about the recent client access, packets, sessions and client device versions. The statistics can be saved to be analyzed later.<br />
In my case the same device as found with LPS caused a lot of sessions and a high CPU (regarding CPU time for the store process).<br />
<br />
After that I disabled the ActiveSync protocol for the user and a couple of minutes later the growth of transaction log files became moderate, I'd say normal. The problem was solved.<br />
<br />
Below I'd like to note some links relative to the tools I used:<br />
<br />
Log Parser + Log Parser Studio:<br />
<a href="http://technet.microsoft.com/en-us/scriptcenter/dd919274.aspx">http://technet.microsoft.com/en-us/scriptcenter/dd919274.aspx</a>
<br />
<a href="http://blogs.technet.com/b/exchange/archive/2012/03/07/introducing-log-parser-studio.aspx">http://blogs.technet.com/b/exchange/archive/2012/03/07/introducing-log-parser-studio.aspx</a>
<br />
<br />
Exchange User Monitor<br />
<a href="http://www.microsoft.com/en-us/download/details.aspx?id=11461">http://www.microsoft.com/en-us/download/details.aspx?id=11461</a>
<br />
<a href="http://www.msexchange.org/tutorials/Microsoft-Exchange-Server-User-Monitor.html">http://www.msexchange.org/tutorials/Microsoft-Exchange-Server-User-Monitor.html</a>
<br />
<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.com12tag:blogger.com,1999:blog-5472158136828312403.post-22482741433537764742012-04-26T15:10:00.000+02:002012-04-26T15:11:46.435+02:00Transport-Rule in Exchange 2010 to prefix the SubjectAssume, you'd like to prepend the subject of an e-mail with a prefix, if the e-mail has been sent from the certain computer and if it has a certain sender name. In this case you can create a new transport rule with Powershell.<br />
<br />
For example, the subject should be prepended by the phrase '[Alert]', if the From address contains 'my_sender@company.com' AND if the computer's name, which the email is sent from, is 'my_computer.company.com'. The powershell command below configures this:<br />
<br />
<pre class="brush: powershell; gutter: false">New-TransportRule
-Name 'My_transport_rule' -Comments 'My comment'
-HeaderContainsMessageHeader 'Received' -HeaderContainsWords 'my_computer.company.com '
-FromAddressContainsWords 'my_sender@company.com' -PrependSubject "[Alert] "
</pre>
<br />
After the command has been executed the rule is active. It acts in the whole Exchange organization and is not restricted to a single server.<br />
<br />
Please note that the argument for the parameter -HeaderContainsWords must contain the name, which the email program on the sender computer actually uses. If the new rule doesn't work as expected, look into the internet headers of a test e-mail and note the computer name, which is in the line Received.Anonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.com0tag:blogger.com,1999:blog-5472158136828312403.post-63238765743119582982012-04-15T14:47:00.000+02:002012-04-26T13:08:57.378+02:00Check_MK plugin to get firmware and service tag of a DELL Powerconnect switchcheck_mk is a great monitoring application! I've been trying it for a couple of days first and I am convinced that check_mk has a big future due to its nice conception, super built-in capabilities and the ability to create own check plugins with less effort.<br />
<div>
<br /></div>
I also tried to create a new check plugin for DELL Powerconnect switches, because the check plugins for such switches provided by check_mk distribution cannot show the firmware version and the service tag of the switch. I copied a provided check plugin (to be more accurate: snmp_info)and modified it a little bit. I'd like to share my result below, please enjoy it!<span style="font-family: inherit;"></span><br />
<a name='more'></a>Save this text right below as file dell_powerconnect_info in the appropriate directory for check plugins (for omd save it under /omd/versions/default/share/check_mk/checks/dell_powerconnect_info)<br />
<span style="font-family: inherit;"><br /></span><br />
<pre class="brush: python; gutter: false">#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
# | | |___| | | | __/ (__| < | | | | . \ |
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
# | |
# | Copyright Mathias Kettner 2010 mk@mathias-kettner.de |
# +------------------------------------------------------------------+
#
# The official homepage is at http://mathias-kettner.de/check_mk.
#
# check_mk is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation in version 2. check_mk is distributed
# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more de-
# ails. You should have received a copy of the GNU General Public
# License along with GNU Make; see the file COPYING. If not, write
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
#
# Adopted by Hermann Maurer at Tue Apr 10 18:12:14 CEST 2012 from
# check_mk plugin snmp_info.
#
# This check_mk plugin checks for the firmware version and service tag
# of a DELL Powerconnect switch. The plugin was tested with DELL Powe-
# rconnect 5424 and 5448 switches
#
def inventory_dell_powerconnect_info(info):
if len(info[0]) >= 2:
return [ (None, None) ]
def check_dell_powerconnect_info(checktype, params, info):
if len(info[0]) >= 2:
return (0, "OK - Firmware: %s, ServiceTag: %s" % (info[0][0], info[0][1]))
else:
return (3, "UNKNOWN - No data retrieved")
check_info['dell_powerconnect_info'] = (check_dell_powerconnect_info, "Powerconnect Info", 0, inventory_dell_powerconnect_info)
snmp_info['dell_powerconnect_info'] = ( ".1.3.6.1.4.1.674.10895.3000.1.2.100", [ '4.0', '8.1.4.1', ] )
#
snmp_scan_functions['dell_powerconnect_info'] = lambda oid: oid(".1.3.6.1.4.1.674.10895.3000.1.2.100.4.0") != None
</pre>
Save the text below in the directory for check plugin documentation files (for omd under /omd/versions/default/share/doc/check_mk/checks/dell_powerconnect_info):<br />
<br />
<pre class="brush: plain; gutter: false">title: Retrieves some information about a DELL Powerconnect switch
agents: dell_powerconnect_info
author: Hermann Maurer (http://hermannmaurer.blogspot.com)
license: GPL
distribution: check_mk
description:
This check retrieves the firmware and service tag and displays them.
It is always OK.
inventory:
One check per SNMP host will be created.
Please note: This check might not be found while an SNMP scan (which you do with
a simple {cmk -I}). You need to explicitely specify the check, if you
want to inventorize it ({cmk --checks dell_powerconnect_info -I}).
Alternatively you can specify it as a manual check.</pre>
<br />
You can download a complete check_mk package from the <a href="http://exchange.check-mk.org/index.php?option=com_remository&Itemid=59&func=fileinfo&id=47" target="_blank">official check_mk exchange site</a>:<br />Anonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.com1tag:blogger.com,1999:blog-5472158136828312403.post-21877871983631955552012-04-09T23:44:00.001+02:002012-04-15T14:51:18.322+02:00Sibirien / Сибирь 2007Hier geht es zum neu veröffentlichen Fotoalbum <a href="https://picasaweb.google.com/105283481729977737834/Sibirien2007?authuser=0&feat=directlink" target="_blank">Sibirien / Сибирь 2007</a>. Fotos im Fotoalbum sind während einer Resise nach Nowosibirsk im Jahr 2007 entstanden. Außer Nowosibirsk zeige ich noch einige Fotos aus der Stadt Anschero-Sudschensk.<br />
<table style="width: auto;"><tbody>
<tr><td><div style="text-align: right;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://picasaweb.google.com/105283481729977737834/Sibirien2007?authuser=0&feat=directlink" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;" target="_blank"><img align="right" height="192" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimhP-hCVjWC-mYfJ-_-LI3Xh-Gp0LiAcMHSXAvesTSCJLn3YlReWiKImrZAKkjV6c5IkwPsfxNljWH24ViRrlhNGMsY7ZsygDJNCunB55MUkMjl6hZVpuDDowKRzQXR-JHtngF7Zlbhcs/s288/IMG_3228-20070731.jpg" width="288" /></a></div>
</div>
</td></tr>
<tr><td style="font-family: arial,sans-serif; font-size: 11px; text-align: right;">Aus <a href="https://picasaweb.google.com/105283481729977737834/Sibirien2007?authuser=0&feat=embedwebsite">Sibirien / Сибирь 2007</a></td></tr>
</tbody></table>Anonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.com0tag:blogger.com,1999:blog-5472158136828312403.post-77911835252768417912012-04-01T13:19:00.000+02:002012-04-01T13:32:32.094+02:00Symantec Backup Exec and Restore to Hyper-V Failover ClusterAssume, that your organization uses Symantec Backup Exec 2010 to backup Hyper-V VMs. What have you to keep in mind, if you need to restore a Hyper-V VM from a backup created by Backup Exec 2010? I've written a couple of points that could be useful to think of to plan such a restore job:<br />
<br />
<ul>
<li>Backup Exec 2010 can restore as to the same Hyper-V failover cluster, where the VM is backed up as well to a different Hyper-V failover cluster. This method can be used to move VMs between the Hyper-V clusters, especially if the Hyper-V clusters are either not connected at all or connecvted through a WAN at a low speed.</li>
<li>Backup Exec 2010 doesn't use failover cluster capabilities while restoring a Hyper-V VM and therefore restores to a single Hyper-V node in the cluster directly.</li>
<li>The restored VM is not failover enabled, because it is restored only to a Hyper-V node. To make the VM failover enabled you must move the restored VM to another Hyper-V node in the failover cluster. Either you export the VM on the Hyper-V node with Hyper-V Manager and import it with Failover Cluster Manager or you can use Microsoft SCVMM to move the VM. Depending on the method of making the VM failover enabled and on the VHD size it takes either much time or a lot of time. You must take this fact into account, when you develop your backup and recovery concept.</li>
<li>Make sure that you enabled the option in the restore job settings to overwrite the existing VM. If you don't enable the option and you do have a VM with the same name existing on your Hyper-V node, Backup Exec 2010 restore job fails only after the whole data is written back from the tape to the Hyper-V node and the VM is going to be registered in Hyper-V. The correction the failure and a new run of the restore job cost time.</li>
<li>Pay attention to the free space of the system drive (usually C:) of the Hyper-V node, which Backup Exec chosen as target to recover to, because the standard restore path points to the system drive.</li>
<li>After the restore has finished you should review the hardware settings of the restored VM, especially if you restored from one Hyper-V failover cluster to a different one. This check includes such things like network name and the VLAN id and may be RAM and CPU settings too.</li>
<li>After the restored VM is up you must check the network settings inside of the VM to be sure, it has network access after the restoration. </li>
</ul>Anonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.com1tag:blogger.com,1999:blog-5472158136828312403.post-26610017259440565242012-03-18T17:44:00.000+01:002012-03-19T23:21:50.242+01:00Пассив: Страдательный залог успеха!Поговорим про построение предложений в современном немецком разговорным языке, которым в русском языке соответствует страдательный залог. Я назвал бы три способа, с помощью которых можно образовать страдательный залог, т.е. такой, который "показывает «претерпевание» объектом какого-либо действия" (см. полную цитату в <a href="http://ru.wikipedia.org/wiki/%D0%9F%D0%B0%D1%81%D1%81%D0%B8%D0%B2_(%D0%BB%D0%B8%D0%BD%D0%B3%D0%B2%D0%B8%D1%81%D1%82%D0%B8%D0%BA%D0%B0)">Википедии</a>). На самом деле, далеко не каждый раз можно образовать одно предложение всеми тремя способами. Кроме того, в зависимости от контекста один из способов образования пассива может звучать довольно неформально.<br />
<br />
<a name='more'></a>Рассмотрим пример:<br />
<br />
<div>
Самый распространённый способ построения страдательного залога в немецком: импользовать пассив: <i><b>Mir wird eine Geschichte erzählt</b></i> = <b><i>Мне рассказывают историю</i></b>.<br />
Этот способ очень просто понять и применять на практике, поскольку он годится как для формальной, так и разговорной лексики без ограничений.<br />
<br />
Следующий способ, сказать то же самое: <b><i>Ich lasse mir eine Geschichte erzählen</i></b>. Если переводить тупо, "в лоб", получилось бы <b><i>Я даю рассказать (себе) историю</i></b> или <b><i>Я позволяю рассказать (себе) историю</i></b>. На самом деле, смысл фразы передаёт всё то же предложение по-русски: <b><i>Мне рассказывают историю</i></b>. Этот способ построения предложений как будто в активном залоге, которым в русском языке соответствует страдательный залог, применяется на мой взгляд довольно нечасто, и как правило, скорее, в разговорной речи. При этом, предложения, построенные таким образом, могут звучать и просто, и очень напыщенно. Т.е. этот способ вполне годится и для высокого слога.<br />
<br />
Ещё один способ сказать ту же фразу: <b><i>Ich bekomme eine Geschichte erzählt.</i></b> Опять же, прямой перевод не имеет смысла. Этому немецкому предложению соответствует русское <b><i>Мне рассказывают историю</i></b>. Этот способ построения страдательного залога встречается почти только в разговорной речи и является, в зависимости от контекста, указанием на речь не очень высокую, может быть, речь простолюдина.<br />
<br />
Ещё примеры:<br />
<br />
Нам сказали, что<br />
Uns wurde gesagt, dass...<br />
Wir haben uns sagen lassen, dass...<br />
Wir haben gesagt bekommen, dass...<br />
<br />
Мне объяснили, что...<br />
Mir ist erklärt worden, dass...<br />
Ich habe mir erklären lassen, dass...<br />
Ich habe erklärt bekommen, dass...<br />
<div id="-chrome-auto-translate-plugin-dialog" style="background-attachment: initial !important; background-clip: initial !important; background-color: transparent !important; background-image: initial !important; background-origin: initial !important; display: none; left: 0px; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; opacity: 1 !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: absolute !important; text-align: left !important; top: 0px; z-index: 999999 !important;">
<div style="-webkit-border-radius: 10px !important; background-color: #363636 !important; background-image: -webkit-gradient(linear, left top, right bottom, color-stop(0%, #000), color-stop(50%, #363636), color-stop(100%, #000)); border-color: #000000 !important; border-width: 0px !important; color: #fafafa !important; font-size: 16px !important; max-width: 300px !important; opacity: 0.8 !important; overflow: visible !important; padding: 8px !important; text-align: left !important; z-index: 999999 !important;">
<div class="translate">
</div>
<div class="additional">
</div>
</div>
<img onclick="document.location.href='http://translate.google.com/';" src="http://www.google.com/uds/css/small-logo.png" style="-webkit-border-radius: 20px; background-color: rgba(200, 200, 200, 0.3) !important; cursor: pointer !important; margin: 0 !important; padding: 3px 5px 0 !important; position: absolute !important; right: 1px !important; top: -20px !important; z-index: -1 !important;" /></div>
</div>Anonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.com1tag:blogger.com,1999:blog-5472158136828312403.post-48355994390218309792012-03-15T23:29:00.004+01:002012-03-15T23:33:37.099+01:00Script to inform about new updates in CentOSA couple days ago I shared my script for OpenSuSE. Now I've re-written that Perl script to speak the language of yum. The script below is intended to run periodically by cron and to send me an e-mail, if new updates have been found for the system. It's nothing extraordinary, yum-cron can this too. But an advantage of my Perl script is that the e-mail is sent only once. No email is sent, if the same updates are found again. The trick is that the Perl script saves the updates (if any) in a temporary file to compare its content then with the updates found at the current run.<br />
<br />
Besides I wanted to see the installed and the available versions of a package side by side. I could unfortunately get this output with yum or repoquery directly.<br />
<br />
<a name='more'></a>Below is an example output of the script:<br />
<br />
<br />
<div class="MsoPlainText">
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">gmp
4.3.1-7.el6
4.3.1-7.el6_2.2<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">initscripts 9.03.27-1.el6.centos 9.03.27-1.el6.centos.1<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">kernel 2.6.32-220.4.2.el6 2.6.32-220.7.1.el6<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">kernel-firmware 2.6.32-220.4.2.el6 2.6.32-220.7.1.el6<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">module-init-tools 3.9-17.el6 3.9-19.el6_2<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">nss 3.13.1-6.el6_2 3.13.1-7.el6_2<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">nss-sysinit 3.13.1-6.el6_2 3.13.1-7.el6_2<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">openssl 1.0.0-20.el6_2.1 1.0.0-20.el6_2.2<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">selinux-policy 3.7.19-126.el6_2.9 3.7.19-126.el6_2.10<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">selinux-policy-targeted 3.7.19-126.el6_2.9 3.7.19-126.el6_2.10<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">systemtap-runtime 1.6-4.el6 1.6-5.el6_2<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">tzdata 2011l-4.el6 2011n-2.el6</span><o:p></o:p></div>
<br />
<br />
<br />
<pre class="brush: perl; gutter: false">#!/usr/bin/perl -w
#
# Written by Hermann Maurer (c) 2012
#
my $recipients = 'yourname@domain.com';
my $lstfile = "/var/lib/yum_pchk.lst";
my $rqucmd = "/usr/bin/repoquery -qa --pkgnarrow=updates --qf=\"%-24{name} %-10{arch} %-16{repoid} %{version}-%{release}\"";
my $rqicmd = "/usr/bin/repoquery -qa --pkgnarrow=installed --qf=\"%-24{name} %-10{arch} %-16{repoid} %{version}-%{release}\"";
my $mailxcmd = "mailx -s \"New updates available for `hostname --long`\" $recipients";
my %arr_new = ();
my %arr_old = ();
my %arr_save = ();
my %arr_installed = ();
my $testflag = 0;
my $param = shift || '';
if ($param eq '--test') { $testflag = 1; }
# we try to read the current output
open RT, "$rqucmd |";
while (<RT>) {
chomp; my $str = $_;
next if m/^$/;
my ($name, $arch, $repo, $version) = split ;
next if (!defined($name) or !defined($version));
$name =~ s/^\s+//; $name =~ s/\s+$//;
$version =~ s/^\s+//; $version =~ s/\s+$//;
if (!exists($arr_new{$name})) {
$arr_new{$name} = $version;
push @arr_save, $str;
}
}
close RT;
# we try to read the saved output
if (!open RT, "<", "$lstfile") {
open RT, ">", "$lstfile";
close RT;
open RT, "<", "$lstfile";
}
while (<RT>) {
chomp;
my $str = $_;
next if m/^$/;
my ($name, $arch, $repo, $version) = split ;
next if (!defined($name) or !defined($version));
$name =~ s/^\s+//; $name =~ s/\s+$//;
$version =~ s/^\s+//; $version =~ s/\s+$//;
if (!exists($arr_old{$name})) { $arr_old{$name} = $version; }
}
close RT;
# we compare the outputs
# only if there is a patch in arr_new, that has not been in arr_old yet, then
# we say, that there is a new update
my $nu_flag = 0;
if (scalar(%arr_new)) {
foreach $key (keys %arr_new) {
if (!defined($arr_old{$key})) { $nu_flag = 1; }
}
}
# we save the current output to the file, if this is not a test run
if (!$testflag) {
open RT, ">", "$lstfile";
foreach (@arr_save) { print RT $_, "\n"; }
close RT;
}
open RT, "$rqicmd |";
while (<RT>) {
chomp;
my $str = $_;
next if m/^$/;
my ($name, $arch, $repo, $version) = split ;
next if (!defined($name) or !defined($version));
$name =~ s/^\s+//; $name =~ s/\s+$//;
$version =~ s/^\s+//; $version =~ s/\s+$//;
$arr_installed{$name} = $version;
}
close RT;
# if we found new updates
if ($nu_flag) {
open MAIL, "| $mailxcmd ";
foreach $name (sort keys %arr_new) {
printf MAIL "%-24s%24s%24s\n", $name,$arr_installed{$name},$arr_new{$name};
}
close MAIL;
exit 1;
}
else { exit 0; }</pre>
<br />
I'm using the Perl script under CentOs 6.2, but other versions of CentOS (and may be other Linux distributions based on Red Hat) should work too.Anonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.com0tag:blogger.com,1999:blog-5472158136828312403.post-73085248244041162102012-03-13T22:49:00.001+01:002012-03-13T22:52:35.646+01:00Mallorca / Майорка 2003<a href="https://picasaweb.google.com/105283481729977737834/Mallorca2003?authuser=0&feat=directlink" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="200" src="https://lh3.googleusercontent.com/-SdFMVIlCGiY/T10g5wq_g3E/AAAAAAAABO4/oRjupzJ2avw/s160-c/Mallorca2003.jpg" width="200" /></a>Diesmal habe ich den Fotoalbum mit Fotos veröffentlicht, die ich auf unserer Reise nach Mallorca im Jahre 2003 gemacht habe. Es war ein toller sehr heißer Sommer, in Europa starben Leute wie Fliegen wegen der Hitze. Auf Mallorca war es etwas kühler als in Deutschland oder in Frankreich, aber es sehr warm.<br />
<br />
Wir haben einen Badeurlaub mit Inselrundfahrt in einem gemieteten Auto kombiniert. Ich muss sagen, Mallorca ist wirklich sehr schön und auf jeden Fall eine Reise wert! Nur eine? Natürlich nicht, sondern viele Reisen wert! ;-)<br />
<div id="-chrome-auto-translate-plugin-dialog" style="background-attachment: initial !important; background-clip: initial !important; background-color: transparent !important; background-image: initial !important; background-origin: initial !important; background-position: initial initial !important; background-repeat: initial initial !important; display: none; left: 0px; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; opacity: 1 !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: absolute !important; text-align: left !important; top: 0px; z-index: 999999 !important;">
undefined</div>Anonymoushttp://www.blogger.com/profile/13022281390562781347noreply@blogger.com0