Tuesday, September 18, 2007

Sendmail Relay

How do you get root's mail to my inbox on a different PC?

1. Edit your sendmail.mc file to include "define(`SMART_HOST', `a.b.c.d')", where a.b.c.d is the ip of a mail server you are allowed to relay through.
2. Generate a new sendmail.cf file using the m4 utility
cd /etc/mail
m4 sendmail.mc > sendmail.cf
3. Restart sendmail
service sendmail restart
4. Edit /etc/aliases to point root's mail to your mail
root: user@domain.com
5. Run the newaliases command
6. It is always a good idea to insure that sendmail is only running on the localhost, this can be verified by checking the sendmail.mc file for

DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

Note: You can always edit the submit.cf file to change the relay host from the localhost to the actual mail relay server. This will allow you to get mail from cronjobs that have you specified in the mailto=... syntax. You would do this if sendmail was not running.

There may be better ways but I have not found them.

Matthew

Wednesday, September 05, 2007

Oracle Stuff

Ok, I am back to posting things I need to remember. Been a bit overwhelmed lately and didn't have the time to even think about stuff I needed to remember. Ridculous if you ask me.

To reboot a server running Oracle 10g:

1. Login as the oracle user.
2. shutdb rev53p1
3. reboot
4. Login as the oracle user.
5. startdb rev53p1

Replace "rev53p1" with whatever database name you are working on. Apparently the one I work on is named rev53p1.

Monday, July 30, 2007

Ok

Ok, so the training in DC did not work out and that sucked. My friends Brad and Robert are there now drinking Yuengling I am sure. That is ok for my hometown brewery has just released their seasonal Oktoberfest, which I have to add is quite fantastic. The next seasonal beer on my horizon is the Christmas Ale, which is one of the best beers I have ever had the pleasure to taste.

Work has been really crazy and I need to show you what I have been up to. In the morning, around 5:00am, I will be joining two Internet architectures together, modifying BGP, the works. I can't wait.

Matthew

Thursday, June 28, 2007

Memories

I was getting ready to sign up for some training at this year's SANSFIRE 2007 in Washington DC when I thought about my previous SANS GIAC certifications. I looked them up and they are still posted on-line. The memories!

Here is my first, probably not very good, practical for the GCFW certification.

And here is my second, hopefully better, practical for the GCUX certification.

It is funny how fast time flies and how much you can learn when you put your mind to it. I will hopefully be attending the SANSFIRE 2007 conference in Washington this year, though I am not going after a major certification. I am going to be taking an official SANS management class and three USENIX hosted training classes, two for Solaris (System Administration and Security) and one for system and network performance tunning. I am still mulling it over, but I am pretty sure this is what I am going to do.

Matthew

Monday, June 25, 2007

RHEL 5

It has been awhile since I have ran anything but WindowMaker on a Linux box. This weekend I installed RHEL 5 on my Dell Precision M65 and I decided to give GNOME a try. I am quite impressed with it so far. It has a Windows fell to it, but not to the point where it is merely trying to imitate it. The only thing I don't like so far is being able to Alt-Right Mouse Click to resize my xterms, but I will have to be ok.

Matthew

Tuesday, June 19, 2007

Mobile Phone Terms

Everyone around me has been talking about text messages, SMS messages, picture mail, picture messages, MMS messages, and so on. This has frustrated me a bit, so I have put together a small definition for the unique items.

SMS - Short Message Service: This is what is commonly referred to as a text message. The text message server is often referred to as a SMSC, for short message service center.

MMS - Multimedia Message Service: This is what is commonly referred to as a picture message. The picture mail server is often referred to as the MMSC for multimedia message service center.

Now that I have typed that out it seems obvious, but that is because you now know the difference.

One of the reasons I needed to make the distinctions is that I am learning how the OTAF (Over The Air Function) technology works. I just read that the SMDPP procotol sends SMS messages. One more sentence like that and I might lose it.

SMDPP - Short Message Delivery Point-to-Point Protocol: Designed to transmit the SMS (short message service) messages.

More to come I am sure.

Matthew

Thursday, June 14, 2007

Office Templates

I rebuild my computer every once in awhile and there are some things you never remember to backup. One of those for me is any templates I have downloaded for Office. I had to go searching for the original template and I was able to find it by rating the my customized version. It sent me off to Office Online and gave me the name of the template I was about to rate. Here is the template I am referring to:

Five Day Event Schedule

I customized this one to make the Vlan and IP allocation spreadsheet at the last job and the current one. If you are interested in that spreadsheet, let me know.

I am about to customize it for keeping track of what I do each day. I used to be annoyed by having to keep track of my time, but now I realize the value when you have many people wanting your time. Of course, I am still annoyed by it.

Matthew

Tuesday, June 12, 2007

A Memento

I did some shopping after work today and one of my purchases came with this small memento.

Tuesday, May 22, 2007

Moving Cacti from one Linux server to another

I had to move Cacti now three times in the past year from one server to another. This process is not a part of the standard Cacti documentation, so you have to go hunting. Here is what I found to be the best process. Well, at least a working process. Many of these specifics are due to our Centos 4.4 kickstart install, i.e. SELinux, etc...

New Server:
1. Insure that MySQL is up and running. Mine wasn't due to SELINUX. I also needed the MySQL client.

yum install MySQL-client-standard
yum install perl-DBD-MySQL
service MySQL start
failed
service mysql restart
failed
vi /etc/my.cnf
(comment out the basedir option
#basedir=/var/lib
service mysql restart
failed
system-config-securitylevel
change permissions to allows mysql
service mysql restart
ok.


2. Download the source rpm or use the one you already have. Rebuild it on the new server and then install it.

rpmbuild --rebuild cacti-0.8.6j-1.src.rpm
rpm -Uvh /usr/src/redhat/RPMS/i386/cacti-*
oops, need other packages
yum install php-mysql php-snmp rrdtool
rpm -Uvh /usr/src/redhat/RPMS/i386/cacti-*
oops, need rrdtool and perl-rrdtool
rpm -Uvh perl-rrdtool-1.2.15-1.el4.rf.i386.rpm rrdtool-1.2.15-1.el4.rf.i386.rpm
rpm -Uvh /usr/src/redhat/RPMS/i386/cacti-*
ok.


Old Server:
1. Stop Cacti from running by removing or moving the crontab job from /etc/cron.d. I just moved it to root's home area in case I need it again.
2. Backup the cacti database:
mysqldump -u root -p cacti > cacti_export.sql (-u username -p prompt me for the password database_name > sql file)
3. Copy the cacti_export.sql file to the new server.
4. Copy the rra, scripts, and any other modified files to the corresponding directory on the new server.
scp -r /var/www/cacti/rra/* root@violet:/var/www/html/cacti/rra/
...That's right, violet lives again.

New Server:

1. Create the cacti databases, import old database, and set appropriate permissions.

mysqladmin --user=root create cacti
mysql -u root -p cacti < /root/cacti_export.sql mysql -u root -p cacti mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'the password of cactiuser';
mysql> flush privileges;
mysql> quit;


2. Verify the permissions are set correctly on the rra/ and log/ directories in cacti's home area.
chown -R cactiuser:cactiuser rra/ log/
It never hurts to make sure, especially after you have copied files from another server.

3. I then go to the log/ directory and tail -f the cacti.log and watch for the next crontab job to run and hopefully see good results.

I think that is all I had to do, but this is the best I can remember. If you have SNMP access lists on your devices or any firewall rules in your path, always make sure to change them to reflect the new server.

EXTRAS:

I install the cacti plugin architecture, www.cactiusers.org, primarily the thold plugin. The steps are easy to follow, so I leave you to follow their documentation.

Matthew

Tuesday, May 15, 2007

Xen

Red Hat Enterprise Linux 5.0 came built with the XEN virtualization software. I installed Centos 5.0 this afternoon on a Dell 2950 with two dual core CPUs. I made sure to select the virtualization option during the OS install. I also had to enable the virtualization option in the BIOS for the CPUs, but in the end I was able to successfully launch the XEN VM manager.

I stumbled upon a lab from Red Hat walking you through how to setup different VM scenarios. I was able to run the command virt-manager and get a window similar to the start screen for VMWare. Tomorrow I am taking my Windows XP disk in and am going to try and get an XP machine up and running in XEN.

It has been a few years since I used Linux extensively. I had begun only using CYGWIN to get my XTerm windows that I love so dearly. After starting the new job I have started running Linux on the laptop again. It always works great if you are ok with having to settle on a few issues...the chief being Office Application interoperability. I always end up with a Windows XP Pro VM using VMware, but I would really like to use the native and open source solution provided from Red Hat. I will let you know how it goes.

Matthew

Wednesday, May 02, 2007

Google Apps

If you have your own domain or perhaps have your own company then you must checkout Google Apps.

I have heard great things about it and it seems to be a way to a possible future for office applications and communications. I have tested one of my domains, linuxfan.us, and it works like a snap. You can login to gmail or gtalk with your own domain. I created a mpbrown@linuxfan.us user and a dbrown@linuxfan.us user for my Dad. I was able to login with each in gtalk.

Very cool.

Matthew

Okay, now we're back so let's talk about...

I was looking for some good Solaris tips on disk arrays and came across this blog, Blog O'Matty, which had several articles pertaining to Solaris, Linux and others. I believe this guy had written an article for the old Sys Admin magazine I used to get. I especially liked the post about the RHEL 5 ftp client and there being a bug in the "C" code.

Red Hat Enterprise Linux 5 FTP bug

It was the first time in over seven years that I looked at "C" code and I didn't understand the difference between a long data type and a long long data type. I do now as I searched Google to find the answer. Quite obvious in the end as it was just that a long data type had a certain limit to how big a number it could hold. A long long data type holds more data...obvious I know.

In the end my search lead me to http://www.sunfreeware.com where I was able to find most of my favorite Linux tools ported to Solaris. Primarily I found vim, bash, and tcpdump, but there is more!

Matthew