Friday, May 27, 2011

Setting up SNMP on OSX 10 Xserve via SSH

setting up snmpd on MAC Server OS X via ssh

verify /usr/sbin/snmpd exists
 ls /usr/sbin/snmpd

verify /usr/share/snmp/snmpd.conf exists
 ls /usr/share/snmp/snmpd.conf

if snmpd.conf doesn't exist, run:
 /usr/bin/snmpconf -i (-i is required to write the file to the correct location)

    set the following options:
 default = all
 1 (snmpd.conf)
 1 (access control setup)
  3 v1/2c ro community name
 4 (Agent operating mode)
  2 (system user agent runs as)
 5 (system information setup)
  1 (physical location of system)
 6 (trap destinations)
  2 (v2c trap receiver)
  3 (v2c inform receiver)
  5 (default trap sink community)

starting snmpd:

restart snmpd:
 kill -HUP <pid>

finally, to make sure it runs at boot time:
Under Snow Leopard there is a slight change to the way services are enabled.
-w       Overrides the Disabled key and sets it to false. In previous versions, this
         option would modify the configuration file. Now the state of the Disabled key
         is stored elsewhere on-disk.

So, to enable the SNMP daemon correctly:
$ sudo launchctl load -w /System/Library/LaunchDaemons/

Monday, May 23, 2011

Configuring DNS Servers on OS X via SSH

Need to set up/change the DNS servers on a Mac OS X system, using SSH.  Command to use is networksetup.  For instance:

$ networksetup /?

for all it's gory details.

What concerns me today is just DNS config for the system.  So, without further adiou, commands are in bold:

user:~ localhost$ networksetup -listallnetworkservices
An asterisk (*) denotes that a network service is disabled.
Ethernet 1
Ethernet 2
*Built-in Serial Port (1)
user:~ localhost$ networksetup -getdnsservers Ethernet\ 1  (observe your character escape sequences)
user:~ localhost$ networksetup -getdnsservers Ethernet\ 2
user:~ localhost$ sudo networksetup -setdnsservers Ethernet\ 1
user:~ localhost$ networksetup -getdnsservers Ethernet\ 1
user:~ localhost$ sudo networksetup -setdnsservers Ethernet\ 2
user:~ localhost$ networksetup -getdnsservers Ethernet\ 2
user:~ localhost$

Friday, May 20, 2011

Making X work on RHEL/CEntOS 5 after VMWare P2V Import

Used the VMWare Standalone Converter running on my local machine to import a RHEL/CEntOS 5 Linux system, and afterward, was greeted with the following (this is cli, the gui had it's own errors):

[root@qa01 ~]# startx
xauth:  creating new authority file /root/.serverauth.9175
xauth:  creating new authority file /root/.Xauthority
xauth:  creating new authority file /root/.Xauthority

X Window System Version 7.1.1
Release Date: 12 May 2006
X Protocol Version 11, Revision 0, Release 7.1.1
Build Operating System: Linux 2.6.18-164.6.1.el5 x86_64 Red Hat, Inc.
Current Operating System: Linux qa01.localdomain 2.6.18-164.11.1.el5 #1 SMP Wed Jan 6 13:26:04 EST 2010 x86_64
Build Date: 16 November 2009
Build ID: xorg-x11-server 1.1.1-48.67.el5_4.1
        Before reporting problems, check
        to make sure that you have the latest version.
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Fri May 20 12:28:27 2011
(==) Using config file: "/etc/X11/xorg.conf"
(EE) No devices detected.

Fatal server error:
no screens found
XIO:  fatal IO error 104 (Connection reset by peer) on X server ":0.0"
      after 0 requests (0 known processed) with 0 events remaining.
[root@qa01 ~]#

Some digging online led me to

I realize it probably makes more sense to add the yum repo, but since I was in a hurry, I just pulled the files manually and did a local install.  The files I needed are listed below:

Files are located at:

      Make sure you get the build number for your version of VMWare and Guest OS




Commands as follows:

    (yes, this has to be done for each rpm)


rpm --import (this saves you from the --no-gpg-check)

yum localinstall <big_list_of_all_rpms_use_tab_complete>

So, now that you're done with all that, it's time to reboot.  Yes, this is needed (remember that kmod rpm you just installed?).  After the reboot, everything works with X just fine.

And now things work virtually like they did before.  (=