Search posterous

Search all posts and users. Type a name, type a favorite song title, whatever! See what comes up.
  

More posterous blogs











More recommended blogs »

Here are posterous posts filed under sysadmin...

LobbyofOne says...

UN declares Afghanistan world's worst place to be born. That should provide some perspective on what we're up against in Afghanistan in achieving security. It is a fools errand if through military action and contractors alone. And if we don't have the money to build infrastructure at home, we certainly don't have it to build infrastructure abroad. This is a distraction to our important domestic agenda. http://ow.ly/FwEV

Filed under: SysAdmin

mrpeterson says...

Here are the instructions for creating a backup of your Open Directory Server.
In this folder (create it if it does not exist) /usr/local/bin/  make a text file called OD_Backup.sh with the following content. Make sure you point the LOCATION to another drive, change the password, and email addresses.

sudo mkdir -p /usr/local/bin
sudo emacs /usr/local/bin/OD_Backup.sh

#!/bin/sh
#set -xv; exec 1>>/tmp/out 2>&1
path=/bin:/usr/bin:/sbin:/usr/sbin export PATH

FILE="/tmp/sacommands.txt"
LOCATION="/Volumes/dbackup/ODM_backup/`date +%Y_%m_%d`"
LOGS="/tmp/logs.txt"

mkdir -p /Volumes/dbackup/ODM_backup
find /Volumes/dbackup/ODM_backup* -mtime +6 -exec rm -rf {} \;
echo "dirserv:command = backupArchive" > $FILE
echo "dirserv:backupArchiveParams:archivePassword = *******" >> $FILE
echo "dirserv:backupArchiveParams:archivePath = /Volumes/dbackup/ODM_backup/`date +%Y_%m_%d`" >> $FILE
serveradmin command < $FILE
echo "To: your@email.here" > $LOGS
echo "From: Server Daily Report <your@email.here>" >> $LOGS
echo "Subject: Daily ODM Backup Report" - `data` >> $LOGS
echo "The Open Directory Master at `hostname` has been successfully backed up. It's location is $LOCATION and will be available for seven days. After seven days, the archive will be deleted." >> $LOGS
cat $LOGS | sendmail -f your@email.here -t
rm -rf $FILE
rm -rf $LOGS

cntr-x cntr-c
sudo chmod 750 /usr/local/bin/OD_Backup.sh

In this directory /Library/LaunchDaemons/ create a file called int.***.OD_Backup.plist where *** is some internal characters, probably dcs. Into that file place the following contents, changing *** whereever you see it.

sudo emacs /Library/LaunchDaemons/int.***.OD_Backup.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>int.***.OD.backup</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/bin/OD_Backup.sh</string>
    </array>
    <key>StartCalendarInterval</key>
    <dict>
        <key>Hour</key>
        <integer>2</integer>
        <key>Minute</key>
        <integer>5</integer>
    </dict>
</dict>
</plist>
cntr-x cntr-c

To start your script use this command.

sudo launchctl load -w /Library/LaunchDaemons/int.***.OD_Backup.plist

This is based on other people's input that I have gathered over the years.

Filed under: sysadmin

kOoLiNuS says...

Lately I had the necessity to create an account and modify another one on an Ubuntu box at work. I've regularly logged on via a ssh -X shell and gave the command sudo users-admin resulting in a "blocked" window ... I mean one on which I wasn't able to unlock the command via an administrative password input.

After a little diggin' on the web I found that the solution is in giving this command:

sudo ck-launch-session users-admin &

which will ask you the administrative password and make the commands on the appearing window

Filed under: sysadmin

kOoLiNuS says...

Filed under: sysadmin

kOoLiNuS says...

 

Filed under: sysadmin

kOoLiNuS says...

Macs interact well with Windows, and with CoRD the experience is a bit smoother. Great for working on the office terminal server, administrating servers or any other time you'd like your PC to be a bit closer without leaving your Mac. CoRD allows you to view each session in its own window, or save space with all sessions in one window. Scale session windows to whatever size fits you—the screen is resized automatically. Enter full screen mode and feel like you're actually at the computer. The clipboard is automatically synchronized between CoRD and the server. For system administrators, CoRD creates a simpler workflow by allowing you to save server information, then quickly connect to that server by using HotKeys or the server drawer. This makes quickly connecting to a specific server easy, even when managing many servers.

 

Filed under: sysadmin

kOoLiNuS says...

The MacEnterprise project is a community of IT professionals sharing information and solutions to support Macs in an enterprise. We collaborate on the deployment, management, and integration of Mac OS X client and server computers into multi-platform computing environments. We welcome your participation through suggestions, comments or contributions.

Filed under: sysadmin

kOoLiNuS says...

I've just updated my RHEL 5.3 box with the last months' updates moving it to the 5.4 release.

Just after the yum update finished I've begun to receive a LOT of messages containing

OBJECT: python /usr/share/rhn/virtualization/poller.py

BODY: libvir: QEMU error : failed to add iptables rule to allow DHCP requests from 'virbr0' : Invalid argument


The solution to that, after a yum whatprovides "*/poller.py" was to remove any instance of the rhn-virtualization-host from my machine (since I do not have any virtualization need).

Cheers,

     Nicola

Filed under: sysadmin

kOoLiNuS says...

Canonical certifies Ubuntu 9.04 Server Edition on latest HP ProLiant servers

 

Filed under: sysadmin

white says...

Monit is a nice tool for monitoring processes.  I know it's widely used in the RoR environment to monitor Mongrel's that goes nutz and eat too much memory.  It's really easy to setup and configure.  You don't need to be too much in systems administration to handle it, so it's a good tool.

ActiveMQ is something not that light.  But this is one of the most powerful and free messaging providers.

Debian is Linux. :)

Okay, so I'll tell you how you can monitor ActiveMQ with Monit.  It's pretty easy, but we should start with a few tweaks of run scripts for ActiveMQ first.  In my specific setup I have ActiveMQ based at /usr/local/apache-activemq-5.2.0 and the platform is Debian Linux.  It's actually running a Xen-based server on Slicehost which I am very happy about, but that's a different story. 

What I am using to manage ActiveMQ is script /usr/local/apache-activemq-5.2.0/bin/linux-x86-64/activemq.  

# /usr/local/apache-activemq-5.2.0/bin/linux-x86-64/activemq 
Usage: /usr/local/apache-activemq-5.2.0/bin/linux-x86-64/activemq { console | start | stop | restart | status | dump }

You probably mention that I'm using the ...-x86-64 one.  There is also a ...-x86-32 and macosx here, which you can use accordingly for your platform (run uname -a to figure this if you're not sure, although you might not be the right guy to set it up if it's so).

Whatever, first of all I had to modify the first lines of /usr/local/apache-activemq-5.2.0/bin/linux-x86-64/wrapper.conf

set.default.ACTIVEMQ_HOME=/usr/local/apache-activemq-5.2.0/
set.default.ACTIVEMQ_BASE=/usr/local/apache-activemq-5.2.0/

There also many other things you can adjust there, but that's your own business.

After that, you can use /usr/local/apache-activemq-5.2.0/bin/linux-x86-64/activemq to start and stop broker.  You might also want to run activemq console at the first time to see all the logs and messages that are coming to console, to confirm that everything works just fine.  If you're using a server with a limited amount of memory available, make sure to adjust -Xmx setting, it can be done at wrapper.conf:

wrapper.java.maxmemory=128

Now time to modify Monit config file a little bit.  I'll edit /etc/monit/monitrc:

check process activemq
    with pidfile /usr/local/apache-activemq-5.2.0/bin/linux-x86-64/ActiveMQ.pid
    start program = "/usr/local/apache-activemq-5.2.0/bin/linux-x86-64/activemq start"
    stop program = "/usr/local/apache-activemq-5.2.0/bin/linux-x86-64/activemq stop"
    if failed host 127.0.0.1 port 61616 then restart                    

The 61616 port is ActiveMQ default one.  It safe to monitor it, as if it doesn't work, something is wrong.  Basically that's it.  Make sure to reload Monit  to load new configuration file and that's it - you're not afraid of restarts anymore.

Filed under: sysadmin