Showing posts with label fedora. Show all posts
Showing posts with label fedora. Show all posts

Wednesday, September 26, 2012

Adobe Acrobat Reader 64-bit CentOS (RHEL or SL) linux LDAP problem

Let me start by saying, "Shame on you Adobe!" for not recognizing an opportunity to continue in the Linux OS realm in a meaningful way... I already use Evince more for PDF files now anyway. No more real Flash support is just another nail in the coffin.

Here's the deal; Adobe doesn't have a 64-bit Acrobat Readear (acroread). So, when you need to install the 32-bit version you get only some of the 32-bit stuff gets installed. More may actually be needed. This is especially true if you have LDAP (openldap) at the center of the authentication realm. You will end up with a message like:
GLib-WARNING **: getpwuid_r(): failed due to unknown user id
As user root, you will need to run:
yum -y install nss-pam-ldapd.i686

Thursday, June 21, 2012

"DEFROUTE" in RHEL, CentOS or Fedora - a usage case for eth0

Here is the situation: There is a user with a remote office that includes networking equipment like printers, backup server etc. He uses a company provided CentOS laptop as the gateway for his network via a cell card since there is no other cheaper option available to get him connected. He travels with the laptop often and I don't need access to the equipment at his office unless he's there. The user always connects either via WIFI or a cell card for VPN connection depending on what is available. The laptop is running openvpn and is connecting to our company's openvpn server. No problem... until I want to also connect the laptops ethernet cable and use NetworkManager and use a DHCP server for the eth0... That's when the VPN drops and the laptop now has an incorrect default route. What's odd is that order of interface startup does not matter... dhcp on eth0 wins no matter what... bummer.


What's happening? Well, normally with DHCP, the client is given a default route as part of the information exchange. That eth0 default route takes over. It's just that simple... unless you give the networking system guidance on what to do in the form of the "DEFROUTE" option. The option has been around for a long time. The current Red Hat Enterprise Linux 6 Deployment Guide has DEFROUTE option hidden in the 8.2.4. Dialup Interfaces section. Here is a chunk of the information from the guide:
DEFROUTE=answer
where answer is one of the following:
  • yes — Set this interface as the default route.
  • no — Do not set this interface as the default route.         

In the past, I did not use the DEFROUTE option. I found that I could just statically assign the eth0 and *not* let NetworkManager have access to it (NM_CONTROLLED=no). In fact with Centos (and the like), NM seems to get disabled as a generally rule.

Also, if this was a server or I wanted to statically assign the interface, it would not be an issue. Just one of those fringe usage cases.

Thursday, June 14, 2012

LTSP 5.2.x rsh server on client install, setup and HOWTO

Don't start with the, "rsh is bad..." message. I know, I know! It's an internal test network and was just easy to do for remote client checking. Besides, the "ltsp-localapps" only works for the logged in user and does not allow for arbitrary root user interaction with the client. If there is a built-in way to do this, let me know. At some point, I may try sshd client setup.

I am using CentOS 6.x as the server OS and customize the client build to be CentOS 6.x also. LTSP 5.2 is the software from k12linux at fedorahostedI don't think that affects the directions below in any way, however. And if this looks like part of a script, you would be correct.

Change the LTS_HOME variable to your own LTSP client build location on the server as required:
export LTS_HOME="/opt/ltsp/i386"

Check to make sure rsh is allowed in securetty for the client:
grep -q "^rsh" $LTS_HOME/etc/securetty && echo rsh >> $LTS_HOME/etc/securetty

Get rsh-server installed into you chroot'd environment:
Option 1 (re)creates the client build to have rsh-server instaled and includes future builds:
edit the "/etc/ltsp/kickstart/Fedora/common/release/el6.ks" and add "rsh-server" *before* the "%end" line. Then (re)run the ltsp-build-client and ltsp-server-tweaks as if a new install:
ltsp-build-client 2>&1 |tee /tmp/ltsp-build-client.out-`date +%Y%m%d%H%M`
cd $LTS_HOME
setarch i386 chroot .
chkconfig rsh on
ltsp-server-tweaks

Option 2 install and setup the rsh-server for this client build only:
cd $LTS_HOME
setarch i386 chroot .
mount -t proc proc /proc
#set proxy if needed
yum install rsh-server
chkconfig rsh on
umount /proc

Get the clients /root to be based on the $LTS_HOME/root from the server and not a tmpfs by commenting the "/root" line of k12linux.rwtab:
sed -i 's/^empty[[:space:]]\/root/#empty\t\/root/'$LTS_HOME/etc/rwtab.d/k12linux.rwtab
OR for you perl peeps
perl -p -i -e "s/^empty\t\/root/\#empty\t\/root/g" $LTS_HOME/etc/rwtab.d/k12linux.rwtab

Note: To safeguard your custom options from accidental rpm update overwrites, please consider creating your own blah.ks file to be referenced in /etc/ltsp/ltsp-build-client.conf.

Properly create a .rhosts file for the clients root user. This script chunk assumes the primary (eth0) interface is the interface that communicates with the clients. If your primary server interface is not the interface for client connection, you will need to add/modify the client's .rhosts file accordingly:
echo "server-`hostname --ip` root" >> $LTS_HOME/root/.rhosts echo "rsh" >> $LTS_HOME/etc/securetty chmod 600  $LTS_HOME/root/.rhosts

Now boot the client and test an rsh command from the server to the client. If you have issues, you will want to add a "shell" option for the client in the correct lts.conf then reboot the client. For i386 arch, the file is "/var/lib/tftpboot/ltsp/i386/lts.conf". This will give you a chance to see the /var/log/messages file if you have not setup remote logging for the client.

To make a custom PXE boot logo change, create/modify a theme run the following command from within the chroot:
ltsp-rewrap-latest-kernel

To apply a new theme
Create a new plymouth theme. You can do this by making simple variations on the stock theme by taking a copy of the default theme using the procedure below. You can replace "newtheme" in the commands below with whatever name you want to give the new theme. This procedure assumes the chroot is in the /opt/ltsp/i386 directory.
Start by copying the folder with this command:

cp -a /opt/ltsp/i386/usr/share/plymouth/themes/solar /opt/ltsp/i386/usr/share/plymouth/themes/newtheme

Now modify "newtheme" as appropriate.  First go into the new theme 
directory by typing:
cd /opt/ltsp/i386/usr/share/plymouth/themes/newtheme

Then rename the .plymouth file by running:

mv rings.plymouth newtheme.plymouth

Edit the .plymouth file and change:

Name=Rings

to:

Name=Newtheme

and change:

ImageDir=/usr/share/plymouth/themes/rings

to

ImageDir=/usr/share/plymouth/themes/newtheme

You may also want to change the background colors. BackgroundStartColor is the color at the top of the screen and BackgroundEndColor is the color at the bottom of the screen. Plymouth will make a gradient of these colors across the screen. For example to make the background change from white to black change the lines:
BackgroundStartColor=0x080808
BackgroundEndColor=0x080808

to:

BackgroundStartColor=0xffffff
BackgroundEndColor=0x000000

When finished making changes save the file.

Next replace the image file named header-image.png with the desired replacement. Do not change the name of this file!

The exact size does not seem to matter as the plymouth will center it in 
the screen above the animated "rings".
You can also get fancy and replace all the other progress images also.

Chroot to the client directory by running:

chroot /opt/ltsp/i386

Activate the new theme with this command:

plymouth-set-default-theme newtheme

Note: you may get an error from sed (ex: sed: warning: failed to set default file creation context to unconfined_u:object_r:usr_t:s0: No such file or directory). This does not seem to cause problems.
Build a new initramfs file with the new theme:

ltsp-rewrap-latest-kernel

Exit the chroot by typing:

exit

and update the tftp directory with the new initramfs by typing:

ltsp-update-kernels

If you use NBD you will also need to run:

ltsp-update-image

Now fire up a client and enjoy the new theme!

Sunday, March 18, 2012

Google Music Manger issue with .ogg file?

Had a very head scratching issue with the (at least the) Linux version of Goggle Music Manger. GMM claims to have uploaded all of the songs and produced some errors on some individual song titles. I didn't think much of the errors since the upload showed successful. I then went to the Google Play page to take the next step of creating some play lists. To my surprise, I only had the original group of files I uploaded a while back and the recently purchased songs from Google (practically a) give-way of albums from last week. I went back to look at the errors noted by Google Music Manager and deleted from disk the files that were named in the errors. I was left with a single error from the "Run Troubleshooter" option; and the error listed that had no filename and a error with just "Failed to upload". Kinda odd to find no filename... Finally noticed that after hitting "Apply" and "Ok" I saw a "0%" on a Al DiMeola song and went searching for it. Immediately after moving the file from the original disk location on my system, Google Music Manger had a little green icon turn on and Google Play began to see the songs. That Al DiMeola song was an otherwise legit and playable .ogg file. I can only suspect that GMM does not like OGG files at this point, but doesn't want to ignore them. Hope my pain is your gain with Google Music Manager.

Thursday, November 10, 2011

Howto get network card vendor, device or kernel module from the /proc and/or /sys filesystem

Work in progress - place to keep notes to myself - may help someone else - cheat sheet kinda page ;)

1. How to get NIC/network card vendor information (scripted example)

for i in `ls -d /sys/class/net/eth*` do   ETH="`basename $i`"   echo -n "$ETH "   NICID="`cat /sys/class/net/$ETH/device/vendor|cut -c3-`"   grep "^$NICID" /usr/share/hwdata/pci.ids done
2. How to get the NIC/network card MAC address (simple example)
cat /sys/class/net/eth0/address
3. How to get the NIC/network kernel module and PCI device info (DETAILS). This can also derive the vendor and device info like above (simple example)
VENDOR="`cat /sys/class/net/eth0/device/modalias |cut -c6-13`" DEVICE="`cat /sys/class/net/eth0/device/modalias |cut -c15-22`" grep -i $VENDOR /lib/modules/`uname -r`/modules.alias | grep -i $DEVICE
OR generally
grep `cat /sys/class/net/eth0/device/modalias |cut -c-22` /lib/modules/`uname -r`/modules.alias
External important links for PCI or kernel module information for Linux:
http://www.pcidatabase.com/

4. How to find the WWN for a SAS end device (the arrary for example) card on RHEL 6, CentOS 6 or similar (simple example)
cat /sys/class/sas_device/*/sas_address
5. How to find the WWN for a SAS card on RHEL 6, CentOS 6 or similar (simple example)
cat /sys/class/sas_phy/*/sas_address

Friday, September 30, 2011

CentOS 6 lpadmin generic postscript printer addition

It really took a while for me to figure out how to add printers via the command line using lpadmin on CentOS 6. So, this information also will apply to newer Fedora users as well as RHEL 6 users:

For generic LPD/LPR Postscript print server:
lpadmin -p printer_name -m drv:///sample.drv/generic.ppd -v lpd://your_print_server/raw1 -D "Your printer description" -L "Your printer location" -o printer-error-policy=retry-job -o printer-is-shared=false -E


For generic LPD/LPR PCL print server:
lpadmin -p printer_name -m drv:///sample.drv/generpcl.ppd -v lpd://your_print_server/raw1 -D "Your printer description" -L "Your printer location" -o printer-error-policy=retry-job -o printer-is-shared=false -E

For Jetdirect/RAW print servers
lpadmin -p printer_name -m drv:///sample.drv/generic.ppd -v socket://your_print_server:9100 -D "Your printer description" -L "Your printer location" -o printer-error-policy=retry-job -o printer-is-shared=false -E

The new part is "drv:///sample.drv/generic.ppd" as the model instead of "postscript.ppd.gz" or similar from the past. This seems to trigger a ppd file build from the script/file of "/usr/share/cups/drv/sample.drv" as part of the cups package.

Notes:
I don't like the default option of not retrying failed jobs. It's a dumb default IMHO! The "-o printer-error-policy=retry-job" is a better choice.

I also tend to turn off sharing as a general rule. You may want it on, however. The "-o printer-is-shared=false" turns off printer sharing.

The Jetdirect/RAW printer socket can change for print servers with multiple ports. First port is 9100, second is 9101 etc. The same kinda process exists for the LPD/LPR print server where "raw1" will increment for printer port as a generic rule.

Saturday, September 17, 2011

CentOS 6.0 Zimbra 7.1.2 Open Source Edition misc setup notes

This not a formal information page... it is a free form of helpful Zimbra bits of information that I needed in order setup a Zimbra server. This Zimbra setup has a seperate openldap server as the authentication server. The ldap specific stuff has been removed. We were moving from a VERY distributed mail setup. Each of the 40 plus remote sites is a mail destination, each with it's own mail server (postfix) and IMAP (dovecot) setup.

#to set env variables needed by zimbra provided services
. ~/bin/zmshutil ; zmsetvars

#sets zimbra to listen in https mode restart of zimbra needed (as zimbra)
zmtlsctl https

#set max upload imap size to 30MB (as zimbra)
zmprov mcf zimbraFileUploadMaxSize 30000000

#to get the zimbraID COS "class of service" (as zimbra)
zmprov gc Default |grep zimbraId:

#this will let all your users login with just the first part of their e-mail address (as zimbra)
zmprov mcf zimbraDefaultDomainName YOURDOMAIN.WHATEVER

#set up bulk add from host with authentication connection for users
getent passwd | egrep -v "thing1|thing2|:x:|:\*:" | sort -t : -k 3g,3 > /tmp/ldapinfo.txt perl zimbra-passwd2zmprov.pl -domain YOURDOMAIN.WHATEVER -password ZIMBRA_PASSWORD < /tmp/ldapinfo.txt > ldapinfo.zmp

#if you still need to route most users through another server until migration (as zimbra)
cat ldapinfo.zmp |perl -e 'while (<>) { chop;print ($_," zimbraMailTransport smtp:MAIL.YOURDOMAIN.WHATEVER:25\n"); }' > ldapinfo1.zmp zmprov < ldapinfo1.zmp

#increase the number of threads for lmtp, imap, http(s) etc (as zimbra) from http://wiki.zimbra.com/wiki/Performance_Tuning_Guidelines_for_Large_Deployments
zmprov ms `zmhostname` zimbraHttpNumThreads 500
zmprov ms `zmhostname` zimbraImapNumThreads 500
zmprov ms `zmhostname` zimbraLmtpNumThreads 50
zmprov ms `zmhostname` zimbraMessageCacheSize 10000 zmlocalconfig -e mailboxd_java_heap_size=9830 #20% of system ram - system ram = 48GB for this example zmlocalconfig -e zimbra_require_interprocess_security=0

#for users moving to Zimbra server that had other mail destinations
zmprov ma "YOURUSER@YOURDOMAIN.WHATEVER" zimbraMailHost ZIMBRA.YOURDOMAIN.WHATEVER zmprov ma "YOURUSER@YOURDOMAIN.WHATEVER" zimbraMailTransport lmtp:ZIMBRA.YOURDOMAIN.WHATEVER:7025

#added next 3 lines to /etc/sysctl.conf based on info from zimbra http://wiki.zimbra.com/wiki/Performance_Tuning_Guidelines_for_Large_Deployments
net.ipv4.tcp_fin_timeout=15 net.ipv4.tcp_tw_reuse=1 net.ipv4.tcp_tw_recycle=1
#also modified /opt/zimbra/conf/my.cnf after memory addition to server
innodb_buffer_pool_size innodb_max_dirty_pages_pct

#/opt/zimbra/mysql/bin/mysqlcheck errors:
mysql.general_log Error : You can't use locks with log tables. mysql.slow_log Error : You can't use locks with log tables.
fix with:
mv /cassens/zimbra/db/data/mysql/*_log.frm /tmp/ /etc/init.d/zimbra restart

#mount zimbra filesystem with "noatime" option

#web pages or external info:
http://wiki.zimbra.com/wiki/Split_Domain
http://wiki.zimbra.com/wiki/Mysql_Crash_Recovery
http://wiki.dovecot.org/Authentication/MasterUsers
http://wiki.zimbra.com/wiki/Zmprov_Examples
http://www.zimbra.com/docs/ne/latest/administration_guide/wwhelp/wwhimpl/js/html/wwhelp.htm#href=ZCS_Admin_Guide_7_NE.Managing_Resources.html
http://www.zimbra.com/docs/ne/latest/administration_guide/wwhelp/wwhimpl/js/html/wwhelp.htm#href=ZCS_Admin_Guide_7_NE.VMware_Zimbra_Collaboration_Server.html
http://wiki.zimbra.com/index.php
http://wiki.zimbra.com/wiki/Performance_Tuning_Guidelines_for_Large_Deployments
http://wiki.zimbra.com/wiki/Open_Source_Edition_Backup_Procedure
http://wiki.zimbra.com/wiki/Moving_ZCS_to_New_Server
http://wiki.zimbra.com/wiki/Guide_to_imapsync

Thursday, July 28, 2011

LibreOffice for CentOS 5 or CentOS 6 install howto

OpenOffice at this point seems to have stalled out with no recent bug fixes. The LibreOffice folks seem to to be be moving forward and fixing issues. This is just a simple install howto for getting LibreOffice onto your otherwise stock CentOS 5 or CentOS 6 desktop system. If you are doing these easy steps, you might as well take the steps to get Thunderbird 5 or FireFox 5 on your system. I have every reason to believe that all of these steps will work just fine for any Scientific Linux 5 or 6. Heck might as well just stall onto the otherwise identical RedHat Enterprise Linux RHEL 5 or RHEL 6.

First download a version of your choice.

UPDATE 05/02/2012: the following code has been updated for the 3.5.3 release of LibreOffice.

wget "http://download.documentfoundation.org/libreoffice/stable/3.5.3/rpm/x86/LibO_3.5.3_Linux_x86_install-rpm_en-US.tar.gz" tar -xzvf LibO_3.5.3_Linux_x86_install-rpm_en-US.tar.gz cd LibO_3.5.3rc2_Linux_x86_install-rpm_en-US/RPMS/ mv desktop-integration/libreoffice3.5-freedesktop-menus-3.5.3-2.noarch.rpm ./ yum remove openoffice\* yum install --nogpgcheck lib*

You will likely want to install the helppack rpm
wget "http://download.documentfoundation.org/libreoffice/stable/3.5.3/rpm/x86/LibO_3.5.3_Linux_x86_helppack-rpm_en-US.tar.gz" tar -xvf LibO_3.5.3_Linux_x86_helppack-rpm_en-US.tar.gz
yum install --nogpgcheck LibO_3.5.3rc2_Linux_x86_helppack-rpm_en-US/RPMS/libobasis3.5-en-US-help-3.5.3-2.i586.rpm

You can copy line for line or copy paste into a script, but the jist of what needs to be done is easy to figure out above.

Redhat menus install nicely

Startup loading bar is nice

LibreOffice starts fast and looks familiar to existing OpenOffice users, but with more bug fixes

One easy upgrade! Nice job LibreOffice peeps! Enjoy.

Thursday, June 23, 2011

novi merge utility for creating a fully updated install (base plus updates)

Novi is a very handy repository merging utility! The purpose of novi is to remove the problem of a system install followed by an immediate update in order to get a system fully patched and ready to go into service. Maybe this quote from the website makes it more clear:
novi is a tool for finding the latest-version RPMs in a tree. You can use it to create Kickstart trees or yum repos that contain the updated RPMS. In the case of Kickstart, this means machines come to life with the updates already applied. Using novi for yum repos trims the size of the repodata files, which reduces client download and processing time.
In reality, novi saves time and resources. This is especially true when dealing with the Fedora distribution.

For example, if an install takes 15 minutes and then the update takes 30 minutes depending how you update (local mirror I hope), you end up with about 45 minutes of time. With novi, that's just 15 minutes total time to get to the same place. Plus you have a much cleaner install without all of those pesky .rpmnew and .rpmsave files cluttering up the pristine new filesystem.

Naturally, I team novi with PXE boot and Kickstart files for the ultimate in lazy installs on systems. I will only focus on the novi portion as much as possible and leave the other pieces for another time.

The most basic setup requires a machine with enough drive capacity to handle the the base install files (however you want to get them) and all of the updates that you may want. I don't want EVERY update, so I tend to limit what I get by excluding packages I will NEVER install. Really, I don't need anyone install AlienArena on any system under my control, for example ;) Luckily, novi can hard link the merged repository and not just add to any space issue. You will also need that server to provide ftp or http services for the merged repository in order to install a client. Ethan McCallum was nice enough to VERY WELL explain most all of the entire concept, already.

My current multi-repository mirror is a CentOS 5.x server. This example is *very simple* Fedora 13 via ftp install. This could also be a http accessible area. As stated above, I do have a fair number of items to exclude via rsync. I took the extra step of rpmbuild'ing the latest CentOS 5 capable version, 1.1.9 from src.rpm. Sadly, most every repository I found only had the 1.1.5 version. CentOS 6 will be able to use the newer 2.1.11 version (when released).

#!/bin/bash BASE_DIR="/var/ftp/pub/yum/Fedora/linux/releases/13" EXCLUDES="$BASE_DIR/13.excludes" INCLUDES="--include-from=$BASE_DIR/13.includes" LOCAL_DIR="$BASE_DIR/updates/" MERGED="$BASE_DIR/merged/i386" ADMINEMAIL=admin@yoursite.com MIRROR_SITE="rsync://mirrors3.kernel.org/fedora/updates/13/i386" LOGFILE="/tmp/`basename $0`.out" cd $MERGED for DIR in $LOCAL_DIR $MERGED_DIR do if [ ! -d "$DIR" ] then mkdir -p "$DIR" fi done rsync -PvaH --bwlimit=300 --timeout=600 $INCLUDES --exclude-from=$EXCLUDES --numeric-ids --delete --delete-after --delay-updates --delete-excluded $MIRROR_SITE $LOCAL_DIR >& $LOGFILE EXIT="$?" if [ "$EXIT" -eq "0" ] then rm -f Packages/*.rpm novi -a hardlink -t $MERGED/Packages $BASE_DIR/os/i386/Packages $LOCAL_DIR/i386 createrepo -g repodata/fce31f091be8211a394d8942fcf4f6cbeffa3d40d87b61af55a97b1a88b46987-Fedora-13-comps.xml $PWD else cat $LOGFILE | "ERROR in $0 on `hostname -s` exit status of $EXIT" $ADMINEMAIL fi

As usual, comments are welcome and appreciated! Again, this is a basic chunk of code that should be better fleshed out by you. It also only includes the i386 branch and is easily extended.

(Note: I know F13 is EOL, but we have been utilizing novi for a long time)

Thursday, May 19, 2011

Dell printer warranty gathering information bash script for linux/unix

We have a LOT of different printer. A large number of them (over 60 and counting) are Dell branded printers. This includes laser printer models like the:
Dell Color Laser 3110cn
Dell Laser Printer 5210n
Dell Laser Printer M5200
Dell 5330dn Laser Printer
Dell Laser Printer 1720dn
Dell Laser Printer 5310n
Dell 2335dn MFP
Dell 2355dn Laser MFP
Dell 1815dn MFP
Dell 1600n MFP
Dell 3335dn MFP

I had a need to make sure to get all newer printers under warranty. Most of the units above have a web interface and most of the time the Service Tag is viewable from that interface. However, I'm very lazy even when it comes to clicking through all of the different types of printer web interfaces... then needing to go to Dell's support web site to manually check each Service Tag...

Naturally, I had to hack some shell script to do all of the dirty work for me. You will need snmpwalk, links, w3m and some added web fluff in the for of sortable columns and line highlighting via Sortable Table 2 java script. The script below will provide info on all printers found, just not warranty or Service Tag for non-Dell printers. The other good part is that you can tell from the "sysDescr.0" what firmware a printer is running also.

I don't remember why I have both links and w3m since this script was created a while back. I just thought it would be nice to post it now. Naturally, you could change out all of the html fluff and dump straight to csv for easy import into whatever you want.

If you have suggestions on code cleanup, I would love to see them. I think I have all the internal company specific stuff taken out and still usable. Enjoy. Sorry the formatting looks *UGLY*, but blogger freaks on the "span" greps in the code and this is the only way I have figured out how to show the code here. I need to verify that the stuff coming out of blogger is still working...

#!/bin/bash

WEBPINFO="/var/www/html/SOME/DIR/Printer_Info.html"
JSPATH="http://`hostname`/SOME/DIR"
PINFO="$WEBPINFO.`date +%y%m%d`"

cat > "$WEBPINFO" << EOF
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Printer Warranty and firmware Information - sortable</title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<script type="text/javascript" src="$JSPATH/sortedTable.js"></script>
<link type="text/css" href="$JSPATH/sortedTable.css" rel="stylesheet"/>
<link type="text/css" href="$JSPATH/nav.css" rel="stylesheet" />
<style>
        .red{color:crimson;}
        #nav{font-size:0.82em;}
</style>
</head>
<body>
<div class="tableWrapper">
<table id="table_1">
<thead>
<tr class="headerLine"><th class="sorttable_alpha">Hostname</th> <th class="sorttable_alpha">sysDescr.0</th> <th class="sorttable_mmdd">warranty expire</th> <th class="sorttable_alpha">Service Tag</th> <th class="sorttable_alpha">Printer name</th></tr>
</thead>
<tbody>
EOF

#get all network based print servers and exclude if needed
for PRINT_SERVER in `lpstat -t | egrep 'lpd://|socket://' |egrep -v 'SOME_PRINTER|SOME_OTHER_PRINTER'| cut -d"/" -f3 | cut -d":" -f1 | sort -u`
do
 unset SER ST PRTS http_proxy
 PRTS=`lpstat -t|grep $PRINT_SERVER[/:]|awk '{ print $3 }'|tr -s ':\n' ' '`
 ping -c 2 $PRINT_SERVER >& /dev/null
 if [ $? -eq 0 ]; then
   MOD=`snmpwalk -Os -c public -v 1 $PRINT_SERVER sysDescr.0  | cut -d":" -f2 `
   echo $MOD | grep -qi dell
   if [ "$?" -eq 0 ]; then
      #2335dn and JD24 and 1815dn are the same ST, but hrDeviceDescr.1 provides firmware version.
      if [ "`echo $MOD | egrep -qi '5330dn|2335dn|2355dn|JD24';echo $?`" -eq 0 ]; then
        ST="`links -dump http://$PRINT_SERVER/printer_info.htm|grep Service|tr -s ' '|cut -f6 -d ' '`"
      elif [ "`echo $MOD | egrep -qi '1815dn';echo $?`" -eq 0 ]; then
        MOD="$MOD `links -dump http://$PRINT_SERVER/printer_info.htm|grep 'Printer Firmware Version:'|cut -f2 -d ':'|tr -s ' '`"
        ST="`links -dump http://$PRINT_SERVER/printer_info.htm|grep Service|tr -s ' '|cut -f6 -d ' '`"
      elif [ "`echo $MOD | egrep -qi '3335dn';echo $?`" -eq 0 ]; then
        ST="`links -dump "http://$PRINT_SERVER/cgi-bin/dynamic/printer/config/reports/deviceinfo.html" |egrep 'Service'|tr -s ' '|cut -f6 -d ' '`"
      elif [ "`echo $MOD | egrep -qi '1720dn';echo $?`" -eq 0 ]; then
        ST="`links -dump "http://$PRINT_SERVER/cgi-bin/dynamic/information.html?path=/printer/info" |egrep 'Service'|tr -s ' '|cut -f6 -d ' '`"
      elif [ "`echo $MOD | egrep -qi '5210n|5310n';echo $?`" -eq 0 ]; then
        ST="`links  -dump "http://$PRINT_SERVER/cgi-bin/dynamic/config/reports/deviceinfo.html" |grep Service|tr -s ' '|cut -f6 -d ' '`"
      elif [ "`echo $MOD | egrep -qi 'M5200';echo $?`" -eq 0 ]; then
        ST="`links -dump http://$PRINT_SERVER/printer/info |egrep 'Service'|tr -s ' '|tr -d '|'|cut -f6 -d ' '`"
      elif [ "`echo $MOD | egrep -qi '3110cn';echo $?`" -eq 0 ]; then
        ST="`links -dump http://$PRINT_SERVER/ews/status/infomation.htm |egrep 'Service'|tr -s ' '|tr -d '|'|cut -f7 -d ' '`"
      fi
      #need a proxy? Squid is a great one!
      #export http_proxy=http://USERNAME:PASSWORD@PROXY_SERVER:PORT
      LINK="http://support.dell.com/support/topics/global.aspx/support/my_systems_info/details?c=us&l=en&s=pub&servicetag=$ST"
      SER="`w3m -no-cookie -dump "$LINK" |grep -A 6 Days|cut -c50-|grep "/"|awk '{ print $3 }'|sort |tail -1`"
    fi
    echo -e "<tr><td><a href="http://${PRINT_SERVER}">${PRINT_SERVER}</a></td> <td>${MOD}</td> <td>${SER}</td> <td><a href="$LINK">${ST}</a></td> <td>${PRTS}</td></tr>" >> $WEBPINFO
  else
   echo -e "<tr><td>${PRINT_SERVER}</td> <td>No Response</td> <td></td> <td></td> <td>${PRTS}</td></tr>" >> $WEBPINFO
 fi
done

cat >> "$WEBPINFO" << EOF
</tbody>
</table>

<p>
Total print servers = `lpstat -t | egrep 'lpd://|socket://' |egrep -v 'SOME_PRINTER|SOME_OTHER_PRINTER'| cut -d"/" -f3 | cut -d":" -f1 | sort -u|wc -l`
Created by $0 at `date` on `hostname`
<script>
        var config = {
                tableId:'table_1', // the only mandatory parameter
                rowOver:'row_over',
                sortMap:'1,2,3:desc'
        }
        var t2 = new Chth.sortTable();
        t2.init(config);
</script>
</body>
</html>
EOF

#keep a historical copy
cp -f $WEBPINFO $PINFO

Friday, May 6, 2011

Fedora 13 VMware Workstation 6.5.4 and 6.5.5 installation issue solved.

We do have the VMware Workstation 7.1 licensed, but I find that it *really* likes to crash on Fedora 13 a lot! So, tried to roll back to the 6.5.4 version I had downloaded from about a year ago and failed on module build. Here is the generally un-helpful error:
/tmp/vmware-root/modules/vmnet-only/vnetUserListener.c: In function ‘VNetUserListenerEventHandler’: /tmp/vmware-root/modules/vmnet-only/vnetUserListener.c:240: error: ‘TASK_INTERRUPTIBLE’ undeclared (first use in this function) /tmp/vmware-root/modules/vmnet-only/vnetUserListener.c:240: error: (Each undeclared identifier is reported only once /tmp/vmware-root/modules/vmnet-only/vnetUserListener.c:240: error: for each function it appears in.) /tmp/vmware-root/modules/vmnet-only/vnetUserListener.c: In function ‘VNetUserListenerRead’: /tmp/vmware-root/modules/vmnet-only/vnetUserListener.c:282: error: ‘TASK_INTERRUPTIBLE’ undeclared (first use in this function) /tmp/vmware-root/modules/vmnet-only/vnetUserListener.c:282: error: implicit declaration of function ‘signal_pending’ /tmp/vmware-root/modules/vmnet-only/vnetUserListener.c:282: error: implicit declaration of function ‘schedule’ make[2]: *** [/tmp/vmware-root/modules/vmnet-only/vnetUserListener.o] Error 1 make[1]: *** [_module_/tmp/vmware-root/modules/vmnet-only] Error 2 make[1]: Leaving directory `/usr/src/kernels/2.6.34.8-68.fc13.i686' make: *** [vmnet.ko] Error 2 make: Leaving directory `/tmp/vmware-root/modules/vmnet-only' Unable to install vmnet

First, make sure to have some basic pre-requisites before you start:
yum install gcc gcc-c++ kernel-headers kernel-devel

Modify accordingly if you are running the PAE kernel:
yum install gcc gcc-c++ kernel-headers kernel-PAE-devel

Next install (or update):
rpm -Uhv VMware-Workstation-6.5.5-328052.i386.rpm
You may need to terminate part of the build process.

The hard part was finding the magical google incantation to finally getting me to THIS VERY helpful link and the real solution of:
cd /tmp tar xf /usr/lib/vmware/modules/source/vmnet.tar -C /tmp tar xf /usr/lib/vmware/modules/source/vmci.tar -C /tmp perl -pi -e 's,("vnetInt.h"),\1\n#include "compat_sched.h",' vmnet-only/vnetUserListener.c perl -pi -e 's,("compat_page.h"),\1\n#include "compat_sched.h",' vmci-only/include/pgtbl.h tar cf /usr/lib/vmware/modules/source/vmnet.tar vmnet-only tar cf /usr/lib/vmware/modules/source/vmci.tar vmci-only

Finally run:
vmware-modconfig --console --install-all

Friday, April 29, 2011

Dell E6410 Fedora 13 32-bit Linux install and mini review

This is a catch up article. More of a documentation piece of (past) success than a current Fedora 13 review.

This Fedora install is a stock 32-bit DVD install (PXE install failed issue with flashing video problem). The target system is a nice Dell E6410 with 4GB RAM, Broadcom BCM4313 802.11b/g, nVidia GT218 [NVS 3100M] rev 162 dedicated video card and Intel I7 CPU. Let me just add the note here and state, for the record, that the Intel I7 ROCKS! The E6410 is a physically solid chassis with precise feel. No cheap feeling plastic on this bad boy. The LCD hinge is firm and smooth with no lateral wiggle or bounce issues. The 14.1 inch screen is bright with no dead pixels. Screen glare is fairly minimal and the function brightness control is handy. I have been a big fan of the Dell Latitude laptops for a long time. The product line continues to excel in many ways. However, please don't mistake this unit for any ultra-portable! Especially with the longer runtime extended battery.

Install with Fedora DVD is best accomplished with the "Basic Video Driver" install selection. Otherwise the screen flashing techni-color screen makes it impossible to install. I choose to install with whole disk encryption as a general rule for any laptop. Let me just say that it is easier to type in a pass-phrase every once in a while than it is to explain why all of the confidential emails or data from a boss is floating around the internet. I will file whole drive encryption under the "CYA" category. Basically, install is click-button-simple. Besides my video issue and encryption desire, there was no real need to not click "next" button when presented. All of the Linux distributions have made HUGE progress in ease of installation over the years. And Fedora is no exception!

Reboot after install leads to a rather disappointing 800x600 resolution login screen. At least there is a login screen at all. First a quick key sequence to dump me to console in order to log in as root in order to do a full update and reboot just to see if that will help my screen resolution issue with the *default* install. I do need to note, I have a standard practice that on any NVIDIA installation, I get the kmod-nvidia drivers or the official NVIDIA driver installed as quickly as possible. I want to see about "stock" install at this point ... but no luck... Sadly, in order to get the 1280x800 capable on this 14.1 WXGA (not WXGA+!) LCD panel I install the kmod-nvidia-PAE drivers (I'm running PAE kernel). However, I still end up with the long dreaded invalid pointer problem and need to remove the "InputDevice" lines in the /etc/X11/xorg.conf file. A reboot an all is better now with video.

The Broadcom BCM4313 is not working out of the box. A quick bit of google'n and an install from the rpmfusion-nonfree-updates repository used for the kmod-nvidia above:
yum -y install broadcom-wl kmod-wl-`uname -r`
modprobe wl
makes the wifi issue go away without the need to reboot. Cutting the ethernet cord an goin' mobile now.

The bluetooth functions without issue. I could pair with my Droidx in seconds. Nice.

Helpful links:
E-Family Reimage “How-To” Guide
E6410 Manuals

Wednesday, April 27, 2011

Fedora 15 beta first impressions - aka mini review

First and foremost please remember THIS IS A BETA. There are going to be issues. However, I find myself more fixated with my issues with the GNOME 3.0 interface than anything else. I know Fedora HAD to move on and stay with the latest and greatest GNOME release. After all that is what is Fedora is known for (and the reason I prefer CentOS/RHEL for servers!). More on GNOME shortly.

My Fedora 15 beta test attempt is happening on real hardware. No virtual container. It's a Dell D630 laptop with 2GB RAM, a dual core Intel T7500 and dedicated nVidia G86M Quadro NVS 135M video card. WIFI is handled by the Broadcom BCM4312 802.11a/b/g chipset. Modest by today's standards.

Normally for laptops, I will do whole disk encryption using a kickstart file. This is just a plain, "select some defaults" and install test. Install worked without issue (as expected). In fact, installs have been very easy for a long to the point of being almost boring. Really just a few clicks and I was done.

Start-up for Fedora 15 beta is very fast. Though not timed, the perceived boot time difference from Fedora 13 to Fedora 15 seemed significant. More specially, Fedora 15 boot time is faster. If I get bored, I may consider actually install Fedora 13 or 14 again just to time the boot-to-login screen time. Many people dig that.

Initially, I was interested in how the nouveau video driver was going to handle my Quadro NVS 135M. Not a real common chipset. The former nv driver has woefully inadequate to say the least. The install and/or nouveau found the LCD SVGA+ 1440x900 without any problems. For any other NVIDIA installation, I would get the kmod-nvidia drivers or the official NVIDIA driver installed as quickly as possible. I'm going to stick it out with nouveau for now. No urgent video need to bail just yet. Not a big compiz fan, however, so that's off.

The install found my wireless card (Broadcom model BCM4312 a/b/g) without any issue. I was able to see AP's in the area. It's nice to see this, "just work". However, wifi passphrase didn't seem to work for some reason. I had to put in the hex key instead in order to connect to the test wifi router. In addition, getting connected to an access point seems to take several seconds longer that with Fedora 13 and GNOME 2.30.

Now for the BIG CHANGE... GNOME 3.0! Not sure if it's Fedora's ruff edges on this beta or my shear newness with GNOME 3.0, but wow it's hard to get used too. Don't get me wrong, a window manager that stays out of your way is good! But one that you can't figure out how to change (yet)?! I was kinda overwhelmed with the Activities and trying to guess under what category a program would be under. Select all and just keep looking. All I wanted to do was fix my touchpad issues. Need to middle click paste with the double mouse button touch pad on the Dell? Can only use the bottom set of buttons... Not sure why yet. I've gotta tell you I use middle mouse/double mouse button paste A LOT as my typing speed and skill is not the best. Also, spent 10 minutes trying to figure out if I could get System Monitor back on my screen or CPU scaling info... and never did...

My solution, at the moment, to GNOME 3.0 is to run LXDE instead! Thank goodness for choice at this time. My frustration rate is high GNOME and back to basics is good. I will likely make more attempts to use the new GNOME, just not tonight.