Wednesday, November 1, 2017

Connecting to the Echo Plus

I have jumped in on moving to the Echo Plus for the promise of the Echo development arena bringing more innovation to the Smart Home arena. Early on though I ran across an interesting scenario. I was moving 9 of my recessed Commercial Electric zigbee bulbs over to the Echo Plus. First 3 bulbs moved, just fine. Move to the living room with 6 bulbs and trouble hit. Long story of trying various pairings of lights, I appeared to get stuck at a capacity issue of only having 6 zigbee devices connect to the Amazon Alexa Echo Plus device. Brief searches and nothing. So the call to Amazon support.

Turns out a simple fix, relatively. Factory reset the Echo. There is a small pinhole opening on the bottom of the device for you to do this. Just stick a pin in to reset. After having all the devices rejoin again, all 9 of the devices were working fine.


Wednesday, April 19, 2017

Issues with Cisco Networking / Ansible 2.3

So Ansible 2.3 was recently released. I'm particularly excited about this release as it introduces a single SSH connection for the playbook to the device instead of individual connections per play.

So I decided to give it a try, and straight out of the box, I have some issues. It appears that I have some connection challenges. I'm going to try to sort them out and document what was tried and the results here. Since I had an issue with moving to Ansible 2.3 initially (rolled back the update), I now have a "dev" box created to do my testing.

"Prod system"
- Centos 7
- GNS3 1.52 running on a different VM
- SSH keys setup from "ansible" to the routers

"Dev system"
- Ubuntu 16.04 LTS
- Same GNS3 target systems
- No SSH keys (so far, will likely get setup later)

Here are the results at this point in time (4/19/17)
$ ansible-playbook cisco_show_clock.yml -i inventories/lab-bulls/hosts -k
SSH password:

PLAY [Show Clock] **************************************************************

TASK [setup] *******************************************************************
ok: [mpls-pe1]
ok: [mpls-pe2]
ok: [mpls-p2]
ok: [mpls-p1]
ok: [mpls-edge]
ok: [mpls-pe3]
ok: [mpls-pe5]
ok: [mpls-pe7]
ok: [mpls-pe4]
ok: [mpls-pe6]

TASK [ios_command] *************************************************************
ok: [mpls-edge]
ok: [mpls-p1]
ok: [mpls-pe2]
ok: [mpls-p2]
ok: [mpls-pe1]
ok: [mpls-pe3]
ok: [mpls-pe4]
ok: [mpls-pe6]
ok: [mpls-pe5]
ok: [mpls-pe7]

TASK [debug] *******************************************************************
ok: [mpls-p1] => {
    "show_clock.stdout_lines[0]": [
        "*04:57:38.826 UTC Sun Apr 16 2017"
    ]
}
ok: [mpls-p2] => {
    "show_clock.stdout_lines[0]": [
        "*02:01:22.742 UTC Tue Apr 18 2017"
    ]
}
ok: [mpls-pe2] => {
    "show_clock.stdout_lines[0]": [
        "*01:09:02.111 UTC Sun Apr 16 2017"
    ]
}
ok: [mpls-pe1] => {
    "show_clock.stdout_lines[0]": [
        "*01:09:53.443 UTC Sun Apr 16 2017"
    ]
}
ok: [mpls-edge] => {
    "show_clock.stdout_lines[0]": [
        "*09:55:57.327 UTC Wed Apr 19 2017"
    ]
}
ok: [mpls-pe3] => {
    "show_clock.stdout_lines[0]": [
        "*01:11:59.303 UTC Sun Apr 16 2017"
    ]
}
ok: [mpls-pe4] => {
    "show_clock.stdout_lines[0]": [
        "*01:47:56.342 UTC Sun Apr 16 2017"
    ]
}
ok: [mpls-pe5] => {
    "show_clock.stdout_lines[0]": [
        "*01:08:07.459 UTC Sun Apr 16 2017"
    ]
}
ok: [mpls-pe6] => {
    "show_clock.stdout_lines[0]": [
        "*01:15:00.435 UTC Sun Apr 16 2017"
    ]
}
ok: [mpls-pe7] => {
    "show_clock.stdout_lines[0]": [
        "*01:10:03.495 UTC Sun Apr 16 2017"
    ]
}

PLAY RECAP *********************************************************************
mpls-edge                  : ok=3    changed=0    unreachable=0    failed=0
mpls-p1                    : ok=3    changed=0    unreachable=0    failed=0
mpls-p2                    : ok=3    changed=0    unreachable=0    failed=0
mpls-pe1                   : ok=3    changed=0    unreachable=0    failed=0
mpls-pe2                   : ok=3    changed=0    unreachable=0    failed=0
mpls-pe3                   : ok=3    changed=0    unreachable=0    failed=0
mpls-pe4                   : ok=3    changed=0    unreachable=0    failed=0
mpls-pe5                   : ok=3    changed=0    unreachable=0    failed=0
mpls-pe6                   : ok=3    changed=0    unreachable=0    failed=0
mpls-pe7                   : ok=3    changed=0    unreachable=0    failed=0
Not working from Ansible 2.3:
$ ansible-playbook cisco_show_clock.yml -i inventories/lab-bulls/hosts -k
SSH password:

PLAY [Show Clock] *****************************************************************************************************************

TASK [Gathering Facts] ************************************************************************************************************
ok: [mpls-p2]
ok: [mpls-pe2]
ok: [mpls-edge]
ok: [mpls-p1]
ok: [mpls-pe1]
ok: [mpls-pe4]
ok: [mpls-pe3]
ok: [mpls-pe5]
ok: [mpls-pe6]
ok: [mpls-pe7]

TASK [ios_command] ****************************************************************************************************************
fatal: [mpls-pe2]: FAILED! => {"changed": false, "failed": true, "msg": "unable to open shell. Please see: https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell", "rc": 255}
fatal: [mpls-pe1]: FAILED! => {"changed": false, "failed": true, "msg": "unable to open shell. Please see: https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell", "rc": 255}
fatal: [mpls-p2]: FAILED! => {"changed": false, "failed": true, "msg": "unable to open shell. Please see: https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell", "rc": 255}
fatal: [mpls-p1]: FAILED! => {"changed": false, "failed": true, "msg": "unable to open shell. Please see: https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell", "rc": 255}
fatal: [mpls-edge]: FAILED! => {"changed": false, "failed": true, "msg": "unable to open shell. Please see: https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell", "rc": 255}
fatal: [mpls-pe4]: FAILED! => {"changed": false, "failed": true, "msg": "unable to open shell. Please see: https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell", "rc": 255}
fatal: [mpls-pe3]: FAILED! => {"changed": false, "failed": true, "msg": "unable to open shell. Please see: https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell", "rc": 255}
fatal: [mpls-pe7]: FAILED! => {"changed": false, "failed": true, "msg": "unable to open shell. Please see: https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell", "rc": 255}
fatal: [mpls-pe5]: FAILED! => {"changed": false, "failed": true, "msg": "unable to open shell. Please see: https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell", "rc": 255}
fatal: [mpls-pe6]: FAILED! => {"changed": false, "failed": true, "msg": "unable to open shell. Please see: https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell", "rc": 255}
        to retry, use: --limit @/home/dir/ansible/cisco_show_clock.retry

PLAY RECAP ************************************************************************************************************************
mpls-edge                  : ok=1    changed=0    unreachable=0    failed=1
mpls-p1                    : ok=1    changed=0    unreachable=0    failed=1
mpls-p2                    : ok=1    changed=0    unreachable=0    failed=1
mpls-pe1                   : ok=1    changed=0    unreachable=0    failed=1
mpls-pe2                   : ok=1    changed=0    unreachable=0    failed=1
mpls-pe3                   : ok=1    changed=0    unreachable=0    failed=1
mpls-pe4                   : ok=1    changed=0    unreachable=0    failed=1
mpls-pe5                   : ok=1    changed=0    unreachable=0    failed=1
mpls-pe6                   : ok=1    changed=0    unreachable=0    failed=1
mpls-pe7                   : ok=1    changed=0    unreachable=0    failed=1

Saturday, April 1, 2017

New Tool Found for NetFlow - NTOP

Today looking at my Cacti graphs I'm seeing a 5 Mbps sustained bandwidth. I'm guessing that is a stream that is going on from the PS Vue service, but I wanted to know for sure. Low and behold, my edge firewall (pfSesne) supports Netflow export. And in searching of Linux Netflow collectors I found my way to NTOP. So far I'm very impressed. More updates to come once I get flows going to it, but here is the install documentation that I used to install it on my CentOS 7 system.

https://devops.profitbricks.com/tutorials/install-ntopng-network-traffic-monitoring-tool-on-centos-7/


Tuesday, March 21, 2017

Home Lab Update - Cacti

Today I was able to successfully install Cacti on a Centos system. This was pretty straight forward with the help of the link:
http://www.tecmint.com/install-cacti-network-monitoring-on-rhel-centos-6-3-5-8-and-fedora-17-12/

Now that I have that marked off my list I will be able to monitor my lab environment (which I will be posting soon).

Sunday, March 19, 2017

New Focus - Coding, then on to Ansible

TLDR Version
CS Minor -- Network Engineer -- DevOps -- Python -- Ansible

First I thought I'd write out how I got to the point that I decided to focus on Ansible as far as networking goes. I had been doing "standard" networking for some time (10+ years). Using commercial tools that were running a large company. Then come in this new culture shift into the environment called DevOps.

Having a CS minor from college and generally understanding programming/coding I started to think a little bit more about how work was getting done, especially during crunch time. I figured out that using code that a computer would run would get consistent results. I looked into the two predominant coding languages of the day (Ruby and Python) and came to the conclusion that Python would be the right language for the networking side of things, even though there was a lot of Ruby development going on. Networking gear has Python interpreters on them, and if it is good enough to run the core of YouTube, it is still worth while.

I set out to learn about how to use Python and here are the recommendations. First for learning the syntax in general and how python works, https://www.codecademy.com/learn/python. I recommend jumping through the lessons there to learn about how to use Python. I used the community several times, so if you have to, don't be discouraged.

After getting the basics down of Python I needed to figure out how to use it to interact with network devices over SSH. To that end I did a lot of searching and found that the key Python package for SSH was Paramiko. Very shortly there after I found out about a site with some tutorials on using Python for Network devices by Kirk Byers - https://pynet.twb-tech.com/blog/. There he has some excellent examples on using Python to do various things for network devices. To this end, Kirk Byers has also written a Python module on top of Paramiko called NetMiko. These are very handy for getting some Python code running and managing networks.

At some point along the journey I had also heard of Ansible to orchestrate an IT environment. This was a natural progression from Python as it was developed in Python. Ansible is my orchestrater of choice as it supports every major system today (Linux (SSH), Windows (WinRM), Network Devices (via SSH)).

So why not just do everything in Python since it is available and not use Ansible? Ansible has many extensions that do very similar capabilities that I was looking to write in Python. I think I would have gotten results quicker using Python, but there is concern around that what happens when the one person that knows the code leaves? So that seems to be a hurdle at this point, so to use a system that keeps things a little cleaner in YAML for code, that seems like a great way to get automation moving forward.

Much of the following posts will be about my experience getting started with Ansible. There were many hurdles that I had to get over that took a lot of my time that I had available. I have gotten to a point where I can interact with network devices with Ansible, both virtual and physical devices. I will start to outline of the hurdles that I had to overcome so you won't have to. I'll also look to give props out to the good articles that I have found out there. This is all about collecting information and helping to have others start using the systems quicker and learning the systems. It will not be about giving all of the answers. There is still a learning function to be done.


Saturday, March 18, 2017

It's Been a While - Glad to be back

It has been a long time since I've posted on this site. Apparently I had an opinion piece that was written in 2012 last, that I don't really believe in any more (I have new information).

I've been doing some work in the space for connecting devices (networking). I'll have some new posts coming and another introduction as well. Looking forward to some good information that other Network Engineers may be able to pick up on as well.

-Josh