Skip to main content

Posts

Showing posts from July, 2014

Reasons I can't use RHEL 7 as my primary "desktop" OS (yet)

2014-07-29 -- This is not a bash-fest, I just need to keep a list of these items so I don't go off and update my OS (again) without considering the issues I ran in to. no easy support for: VPNC MP3 playback VMware Workstation Which, essentially stems from poor EPEL support (at this time) and NO rpmfusion. Which really bums me out.. I was really liking the look-and-feel of RHEL 7 workstation.  I'm sure those things will be resolved soon enough. 2014-11-07 - trying again.  Going to load RHEL 7 Workstation on my desktop to see how things going.  Criteria remains the same: hope that the VPN, MP3 and VMware Workstation now work on EL 7. No RPMfusion for EL 7?  Need to find an actual post regarding this and not some seemingly random Tweet.

Script to update Dell Firmware

There are a few other scripts/tools out there to do this.. but they all seem to have some stupid dependencies (this one is no exception). #!/bin/bash # $Id: update_firmware.sh,v 1.9 2014/04/25 18:42:55 root Exp root $ # Author: James.Radtke@company.com # Purpose:  Script to download and apply firmware updates # Status:   Stable, but likely needs some work # TODO:     I would like to require a flag to run the REBOOT REQUIRED updates # Maintained at:   rhnsat01:/root/bin/update_firmware.sh #         # #  VARIABLES # FIRMWARE_LOG=/var/log/dell_firmware.log PRETTYDATE=`date +%Y%m%d-%H%M` REBOOT_RECD=0 # PLEASE NOTE: EACH OF THE PACKAGES LISTED IN THE PKGS VARIABLES ARE THE #   LEAST-COMMON-DENOMINATOR FOR EACH PACKAGE. (i.e. they only differ by version number). NON_REBOOT_PKGS="ESM Lifecycle-Controller Power_Firmware" REBOOT_PKGS="R[1-9][12]0_BIOS BIOS Network_Firmware SAS-RAID_Firmware Fi...

Red Hat Satellite: Cleanup "Actions" history

I had run in to a situation where my Satellite had several hundred-thousand previously run scheduled jobs sitting in the history... I could delete them 25 at a time... and if I did "Select All" it would puke. So - I created the following #!/usr/bin/env python import xmlrpclib import time SATELLITE_URL = "http://rhnsat01.company.com/rpc/api" SATELLITE_LOGIN = "satadmin" SATELLITE_PASSWORD = "notMyPassword" client = xmlrpclib.Server(SATELLITE_URL, verbose=0) delete = 1 key = client.auth.login(SATELLITE_LOGIN, SATELLITE_PASSWORD) ############################### # CHANGE THINGS AFTER THIS LINE # ## Delete all Failed Actions x = "Deleting all Failed Actions" print(x) failed_list = client.schedule.listFailedActions(key) action_ids=[] for action in failed_list:     action_ids.append(action['id']) archive_result=client.schedule.archiveActions(key,action_ids) ## Archive all Completed Actions ## Generate a...

Satellite Backup Script 5.5

#!/bin/bash ## Database Backup Script - Embedded Only prettyDATE=`date +%F` BACKUPS=/var/satellite/backups BACKUPDIR=${BACKUPS}/${prettyDATE} DBBACKUPDIR=${BACKUPS}/${prettyDATE}/DB mkdir -p ${BACKUPDIR} mkdir -p ${DBBACKUPDIR} chown oracle:dba ${DBBACKUPDIR} /usr/sbin/rhn-satellite stop echo "-- `date`" tar -cvf ${BACKUPDIR}/var_lib_rhn_kickstarts_upload.tar /var/lib/rhn/kickstarts/upload/ tar -cvf ${BACKUPDIR}/var_lib_cobbler.tar /var/lib/cobbler/ tar -cvf ${BACKUPDIR}/etc_cobbler.tar /etc/cobbler/ tar -cvf ${BACKUPDIR}/etc_rhn.tar /etc/rhn/ su - oracle -c "db-control backup ${DBBACKUPDIR}" echo "-- `date`" /usr/sbin/rhn-satellite start echo "-- `date`" su - oracle -c "db-control verify ${DBBACKUPDIR}" echo "-- `date`" # TRAVERSE THE BACKUP DIR TO DELETE OLD(ER) BACKUP FILES # I DO NOT LIKE USING A VARIABLE FOR THE PATH FOR THIS TYPE OF COMMAND find /var/satellite/backups -type d -mtime +14 -exec rm -rf {} \; /usr/sbin/rhn-...

Snapshot cleanup expect script for Satellite

My environment does not see a lot of general maintenance or attention in particular ways.  I will occasionally find something that is either causing us grief, or about to... One of those items is the size of my Satellite Database.  The size is now an issue as I hope to upgrade to Red Hat Satellite 5.6 and migrate to Postgres in the process (yeah!). Some folks have recommended: * remove unused channels (seems logical enough) * remove unused/older snapshots I'm fairly certain that nobody else in my environment knows or realizes that snapshots even exist, let alone why they are advantageous.  Therefore, I intend to truncate the snapshots to only include those created in the last 4 months. #!/usr/bin/expect -f # # Expect and autoexpect were both written by Don Libes, NIST. # set force_conservative 0  ;# set to 1 to force conservative mode even if                    ...

Filesystem resize issue (ext4)

Error [root@dvgllpsmsapp12 apps]# resize2fs /dev/mapper/ORAAPPVG-LV_APPS resize2fs 1.39 (29-May-2006) Filesystem at /dev/mapper/ORAAPPVG-LV_APPS is mounted on /apps; on-line resizing required Performing an on-line resize of /dev/mapper/ORAAPPVG-LV_APPS to 275251200 (4k) blocks. resize2fs: Inappropriate ioctl for device While trying to add group #4400 Resolution [root@dvgllpsmsapp14 ~]# lvresize -L+500g /dev/mapper/ORAAPPVG-LV_APPS Extending logical volume LV_APPS to 1000.00 GB Logical volume LV_APPS successfully resized [root@dvgllpsmsapp14 ~]# yum -y install e4fsprogs Loaded plugins: downloadonly, product-id, rhnplugin, security, subscription-  : manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. This system is receiving updates from RHN Classic or RHN Satellite. Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package e4fsprogs.x86_64 0:1.41.12-4...

Satellite UNDO_TBS is full

[root@pdgllprhnsat01 rhnsat]# spacewalk-remove-channel -c rhel-i386-server-5 -c dell-om-platform_independent-rhel-i386-server-5 -c rhel-i386-server-productivity-5 -c rhn-tools-rhel-i386-server-5 Deleting package metadata (9499):                   ________________________________________ Removing:         ERROR: unhandled exception occurred: ((30036, "ORA-30036: unable to extend segment by 8 in undo tablespace 'UNDO_TBS'\n", 'delete from rhnChannelPackage where package_id = :package_id')). Traceback (most recent call last):   File "/usr/bin/spacewalk-remove-channel", line 560, in ?     sys.exit(main() or 0)   File "/usr/bin/spacewalk-remove-channel", line 147, in main     skip_channels=options.skip_channels)   File "/usr/bin/spacewalk-remove-channel", line 305, in delete_channels     _delete_rpms(rpms_ids...

Beginning Python

#!/usr/bin/env python __author__ = "James Radtke" __copyright__ = "Copyright 2013, Linux Revolution" __credits__ = ["James Radtke"] __license__ = "GPL" __version__ = "0.0.1" __date__ = "20130108" __maintainer__ = "James Radtke" __email__ = "james.radtke@linuxrevolution.com" __status__ = "Development" import commands from os import path, access, R_OK # W_OK for write permission. # First, see if FILE exists FILE='/tmp/test' if path.exists(FILE) and path.isfile(FILE) and access(FILE, R_OK): print "File: " + FILE + " exists" else: print "ERROR: " + FILE + " File is missing or is not readable" # See if process is running PROCNAME = 'bash' OUTPUT = commands.getoutput('ps -A') if PROCNAME in OUTPUT: print "Process " + PROCNAME + " was running" else: print print "ERROR: Process "...