Keith Smith - My Blog

Keith Smith - My Blog


Export VM as an OVF from VMware Fusion

Saturday, June 21, 2014 - Posted by Keith A. Smith, in VMware

I run VMware Fusion on mac for the rare occasion that I need to do something in windows. I never had a need to export any of my fusion VM's until recently, a colleague of mine wanted a copy of a VM I had. Unfortunately the Fusion GUI does not offer any way to export VM’s, so like with everything else when the GUI doesn’t offer a feature I head over to the command line (terminal in this case). After to digging around I found that this command works


./ovftool --acceptAllEulas /Users/admin/Documents/Virtual Machines.localized/IDM.vmwarevm/IDM.vmx 

~/Users/admin/Documents/IDM.ova

View Comments 0 Comments
Share Post   


Fog aka Free Open Ghost Compile Kernel

Wednesday, May 28, 2014 - Posted by Keith A. Smith, in FOG aka Free Open Ghost

I have been running fog now for about 6 years now and one of the things that i haven't had to do a lot of was compile a kernel in order to make some device compatible with fog. There was a time period that i had to do a lot of this and i never made note of the commands l used. I decided to test myself on an ubuntu machine to see if i could still do this the right way,
 
tar zxvf fog*

sudo tar -xvf filename.tar.xz

cd into the downloads/fog_0.32/kernels

sudo cp core.config /usr/src/kernels/linux-3.13.6/.config

sudo make xconfig

sudo make ARCH=i386 bzImage
 
The results......yep still got it!! and bonus points this time because i blogged about it now.
View Comments 0 Comments
Share Post   


Show command multiple filtering

Wednesday, May 21, 2014 - Posted by Keith A. Smith, in Network

Normally when we do show command we make use of the "|" to filter and put in keywords after like include, exclude, begin and section. As we all know "include" means show only that matches the string like for the example below.





R1#sh run | inc CISCO
neighbor CISCO peer-group

We can do some multiple command filtering like the example below using the "include" keyword. Let's say we want to see the interface name, then the description, the OSPF cost and if its configured with the "mpls ip" command.





R1#sh run | inc interface |^ description |^ ip ospf cost |^ mpls ip
interface FastEthernet0/0
description towards LAN
ip ospf cost 100
mpls ip

sh run | inc Keith
View Comments 0 Comments
Share Post   


More on cisco command output filtering

Wednesday, May 21, 2014 - Posted by Keith A. Smith, in Network

Finding the right piece of information that you need from a Cisco router can often be a challenge. For example, if you use the show running-config command on a large production router, you can easily end up with 25 pages of text output.

Locating that one piece of information you're looking for can take a lot of time. Once you find it, you might need to make a change, only to have to rerun the command and go through the whole process again.

However, there are some shortcuts you can take to find this information more quickly. Let's looks at some filtering options you can use when maneuvering through long command output on a Cisco router.

Filter output using line numbers

You can use the show running-config linenum command to configure the system to include line numbers at the start of each line in the output. Here's an example:

Current configuration : 59161 bytes




    1 : !
    2 : ! Last configuration change at 09:25:35 CDT Tue Aug 16 2005 by root
    3 : ! NVRAM config last updated at 09:25:36 CDT Tue Aug 16 2005 by root
    4 : !
    5 : version 12.3
    6 : service tcp-keepalives-in
    7 : service tcp-keepalives-out
    8 : service timestamps debug datetime msec localtime show-timezone
    9 : service timestamps log datetime msec localtime show-timezone
   10 : service password-encryption

Once you have line numbers to use as reference points, you can then filter the output by starting at a certain line or only returning a specified line. Here's an example of starting the output at a specific line:

Router# show running-config linenum | begin 6 : 




    6 : service tcp-keepalives-in
    7 : service tcp-keepalives-out
    8 : service timestamps debug datetime msec localtime show-timezone
    9 : service timestamps log datetime msec localtime show-timezone
   10 : service password-encryption

Here's an example of requesting only one line returned in the output:

Router# show running-config linenum | include ( 6 : )




    6 : service tcp-keepalives-in

Filter output using Include, Exclude, or Begin

You can also use certain commands to help filter your output. For example, you can use the include command to see only lines that include the word service. Here's an example:

Router# show running-config | include service
service tcp-keepalives-in
service tcp-keepalives-out
service timestamps debug datetime msec localtime show-timezone
service timestamps log datetime msec localtime show-timezone
service password-encryption

You can use the begin command to start the output at a certain line (such as an interface). Here's an example:

Router# show running-config | begin interface Serial3/0
interface Serial3/0




 description MPLS T-1
 bandwidth 1544
 ip address 10.0.100.2 255.255.255.252
 no ip proxy-arp (truncated)

In addition, you can use the exclude command in the same way if there's something particularly long that you don't need to see in the output.

The best thing about these three commands is that they work with almost any output on the router. For example, let's say I wanted to see all routes that begin with the IP address 10.83.x.x. But it doesn't work if I use this:

Router# show ip route 10.83.0.0        
% Subnet not in table

However, if I use something like the following example, I can see all of the routes that begin with 10.83.x.x:

Router# show ip route | include 10.83.     
O       10.83.100.8/30 [110/2370] via 10.83.100.2, 05:32:27, Serial1/2:0.83
O       10.83.100.4/30 [110/2115] via 10.20.100.2, 05:32:27, Serial1/2:0.2
C       10.83.100.0/30 is directly connected, Serial1/2:0.83
O       10.83.103.0/24 [110/2195] via 10.83.100.2, 05:32:27, Serial1/2:0.83

Filter output by interface

On the other hand, if you only need to see the output of one specific interface, you can also filter output in that way. Here's an example:

Router# show running-config interface Serial3/0        
Building configuration...

Current configuration : 209 bytes
!




interface Serial3/0
 description MPLS T-1
 bandwidth 1544
 ip address 10.0.100.2 255.255.255.252
 no ip proxy-arp
 no ip mroute-cache
 no fair-queue
 no cdp enable end

Start searching your output

Did you know that you can search directly from the show running-config command's output? If you use the show running-config command, you should see a –More– prompt at the end of each page of output (depending on your page length).

If you enter a forward slash [/] at this prompt, it will replace the prompt with the slash, and you can then type in whatever you want to search for. Press [Enter], and it will say filtering and then begin showing you the results of your search. (This is exactly how the UNIX pg command works.) Here's an example:

/interface Serial3/0
filtering...
interface Serial3/0




 description MPLS T-1
 bandwidth 1544
 ip address 10.0.100.2 255.255.255.252
View Comments 0 Comments
Share Post   


How to become a linux sysadmin

Friday, October 11, 2013 - Posted by Keith A. Smith, in Linux


1.  Set up a KVM hypervisor.

2.  Inside of that KVM environment, create and install a Spacewalk server. Use CentOS or Rocky as the distro for all work below. (For bonus points, set up errata importation on the CentOS channels, so you can properly see security update advisory information.)

3.  Create a VM to provide named and dhcpd service to your entire environment. Set up the dhcp daemon to use the Spacewalk server as the pxeboot machine (thus allowing you to use Cobbler to do unattended OS installs). Make sure that every forward zone you create has a reverse zone associated with it. Use something like "internal.lab" (but not ".local") as your internal DNS zone.

4.  Use that Spacewalk server to automatically (without touching it) install a new pair of OS instances, with which you will then create a Master/Master pair of LDAP servers. Make sure they register with the Spacewalk server. Do not allow anonymous bind, do not use unencrypted LDAP.

5.  Reconfigure all three servers to use LDAP authentication.

6.  Create two new VMs, again unintendedly, which will then be Postgresql VMs. Use pgpool-II to set up master/master replication between them. Export the database from your Spacewalk server and import it into the new pgsql cluster. Reconfigure your Spacewalk instance to run off that server.

7.   Set up a Puppet Master. Plug it into the Spacewalk server for identifying the inventory it will need to work with. Use ansibe for deployment purposes, again plugging into the Spacewalk server. Alternatives you could also try would be Foreman/Katello.

8.  Deploy another VM. Install iscsitgt and nfs-kernel-server on it. Export a LUN and an NFS share.

9.  Deploy another VM. Install bacula on it, using the postgresql cluster to store its database. Register each machine on it, storing to flatfile. Store the bacula VM's image on the iscsi LUN, and every other machine on the NFS share.

10. Deploy two more VMs. These will have httpd (Apache2) on them. Leave essentially default for now.

11. Deploy two more VMs. These will have tomcat on them. Use JBoss Cache to replicate the session caches between them. Use the httpd servers as the frontends for this. The application you will run is JBoss Wiki.

12.  You guessed right, deploy another VM. This will do iptables-based NAT/round-robin load balancing between the two httpd servers.

13.  Deploy another VM. On this VM, install postfix. Set it up to use a gmail account to allow you to have it send emails, and receive messages only from your internal network.

14.  Deploy another VM. On this VM, set up a Nagios server. An alterantive to Nagios would be Zabbix. Have it use snmp to monitor the communication state of every relevant service involved above. This means doing a "is the right port open" check, and a "I got the right kind of response" check and "We still have filesystem space free" check.

15.  Deploy another VM. On this VM, set up a syslog daemon to listen to every other server's input. Reconfigure each other server to send their logging output to various files on the syslog server. (For extra credit, set up logstash or kibana or greylog to parse those logs.)

16.  Document every last step you did in getting to this point in your brand new Wiki.

17.  Now go back and create Puppet Manifests to ensure that every one of these machines is authenticating to the LDAP servers, registered to the Spacewalk server, and backed up by the bacula server.

18.  Now go back, reference your documents, and set up a Puppet Razor profile that hooks into each of these things to allow you to recreate, from scratch, each individual server.

19.  Destroy every secondary machine you have created and use the above profile to recreate them, joining them to the clusters as needed.

20.  Bonus exercise: create three more VMs. A CentOS and 7 machine. On each of these machines, set them up to allow you to create custom RPMs and import them into the Spacewalk server instance. Ensure your Puppet configurations work for all three and produce like-for-like behaviors.

Do these things and you will be fully exposed to every aspect of Linux Enterprise systems administration. Do them well and you will have the technical expertise required to seek "Senior" roles.

View Comments 0 Comments
Share Post   


Page  <1...16171819>