Showing posts with label Nagios. Show all posts
Showing posts with label Nagios. Show all posts
Wednesday, August 6, 2014
iPhone is still an awesome SysAdmin tool. Literally fighting and warding off hackers with an iPhone.
As many of my readers know, I carry two phones. An iOS and an Android phone. However, when it comes to any real work, I use my iPhone. It has been very reliable and I've been using different versions of the iPhone to avert disaster in the last 7 years. Sure, many of these things you can do with Android. However, I have had problems mostly with VPN connectivity. As many already know, Android did not support IPSEC group cisco-vpn for many, many years. Thus, I've been using iOS as my go-to device. The largest screen in the world can't help you if you don't have connectivity access.
I also prefer some of the iOS equivalent apps. For example, Connectbot and JuiceSSH are no equivalent to iSSH.
Well, here is an example I would share with some of my readers why the iPhone still rocks!
Typical crisis scenario: Waiting in line for the latest movie, Guardian of the Galaxy, and the phone is ringing off the hook with NAGIOS notifications. NAGIOS is telling you that some servers are degraded or offline. You can either rush to the car or back to the office or.... Server meltdown and crisis needs to be fixed ASAP. What do you do? Well, that has happen to me on many, many occasions. When it does happen, I rely on my iPhone. It also happend over the past weekend.
I use NAGIOS which is an enterprise grade network and intrusion monitoring. And boy, I constantly get text and email messages for down servers or degraded services. You know, the kind where Russian and Chinese hackers are chomping away. It is good to SSH in and apply a firewall rule just like that. I can restart services or launch redundant failovers.
Besides sysadmin duties, there are plenty of other scenarios where it comes in handy. Often times, I may be at lunch and a client wants me to export a MySQL report into an Excel spreadsheet. Easy. MysqlDump the query to a CSV delineated file then convert into Excel .XLS on the iPhone. And yes, I do this on a small 4" screen. iSSH has really good multi-touch gestures that makes up for a smaller screen. I actually prefer using iSSH over JuiceSSH on my HTC ONE M8. Thus, you can see why I a still a dedicated iOS user.
The other day, a client's email server was getting hammered with a brute dictionary attack. Within 15 minutes, I installed Fail2Ban and scp (Secure shell copied) a working configuration that monitors SASL intrusion with my iPhone. The attack was a coordinated brute force password "guessing" on the SMTP mail server. They hit the servers hundreds of times per second so that the server can't handle regular requests. With my iPhone, I logged in via SSH and scp a working /etc/ config (from another server) and bam, Fail2Ban was monitoring the mail logs and blocking African, Russian, and Chinese hackers in real-time. All of this was done in real time. And it was done using an iPhone.
Fail2Ban is actually very cool but that can be a different subject on a different blog post. Basically, it is a POSIX daemon that monitors log files and can be configured to block malicious intruders. You can configure it to monitor different services and if there are so many attempts (say 3-4), you can deny them via deny-host of through a firewall IPFW rule. If this sounds all alien to you, lets just say, all you need is console access to install, configure and set-up.
If I can get root and shell access, I can handle crisis like this with my 4" wonder gadget. Another crisis averted. So the point is, devices are tools and you make it is what you want it to be. Thus, I still get a laugh when people say you can't do real work on a mobile device.
Friday, May 25, 2012
Nagios
Nagios is billed as a network, infrastructure monitoring app.
There is a wiki definition of it. http://en.wikipedia.org/wiki/Nagios
To me, it has saved my butt more than a hundred times. In simple terms, it is a system I use to monitor my company's network, server and entire IT assets. When a mail server goes down, I am instantly paged and notified. This is the tool used to monitor your servers,switches, hardware for downtime.
This is one of the killer "Linux" apps. Sure, it probably runs on other platforms. And sure, there are probably other 'infrastructure' monitoring apps that work with Windows with minimal fuss. However, Nagios is free and runs on minimal hardware. In essence, cheap. It takes an afternoon of your time to configure some /etc/ files. Trust me, you will be rewarded in so many intangible ways.
Nagios was one of those first examples of how IT snuck in Linux boxes into the closets of most enterprises. About 7-8 years ago, I built an inexpensive Linux rack server from the local white box computer shop. Back when I was younger and piecing motherboards together was my idea of fun, Linux started to become my de-facto go-to solution for everything. The entire cost of the project was a few hundred dollars using the cheapest PC components we could scrape together.
With Nagios, I would know way beforehand when a mail server went down. I would prefer a machine to tell me something is wrong versus the boss calling and telling me why he/she can't get his mail.
The years went by and the box did its job. About two years ago, as we started to consolidate physical machines into virtualized machines. It also gave me a reason to upgrade to version 3 from whatever I was running previously. I rebuilt a Nagios instance on a small JeOS (Just enough OS) build of Ubuntu. It was very minimal, very small, and very lightweight. Console only, the VM image was portable enough to be put on a small USB stick. That is the power of Linux.
In short, all you really need to do is make some config files and enable the service. It runs as a daemon. The most common action is obviously notification. You can also script external commands. A nifty thing to do is launch a VM failover in the event that a primary server is unavailable.
Typical email responses from Nagios
Everything is routed to my iPhone. I've been blogging about various Android devices in my other posts so now it is time to give some iPhone love. The iPhone/iPad is the only tool I depend on using with Nagios.I can access and configure my Nagios box from anywhere my iPhone has a signal:
1) I have a secured CISCO VPN tunnel that works flawlessly with iOS (It has problems with ICS sandwich). If I can't connect to my network, a whiz-bang dual core 4.7 720p screen is of no use to me.
2) I get notifications via PUSH notifications via dovecot/cyrus IMAP mail server. My Galaxy Nexus only supports PUSH emails via GMAIL or Exchange. K-9 email client in the Play store doesn't work for me.
3) Excellent console access. I prefer the SSH app on my 3.5" small iPhone screen over Android's Connectbot running on my 4.65" Galaxy Nexus or 7" Galaxy Tab 2.
It is all about usability and the iPhone works. Android is flakey with PUSH IMAP and others have suggested I use SMS. It is critical that I get notified within a few seconds versus 5-10 minutes later. Now, you see why the iPhone works for me.
You can configure Nagios to send SMS but I've had both ATT and Verizon block my message because my notifications did not come from a mail server with proper MX records (e.g. if my primary mail server goes down!). In addition, the 30-40 messages that can come at once. I can see why they would be blocked it as SPAM. Hence, I configured Nagios to send alternate notifications to Cyrus/Dovecot IMAP. I love open source. I find it strange that Apple's iOS has better support for open source linux based mail servers than Google.
If you are serious about your network and infrastructure, I suggest you research Nagios and see if it will work for you.
To end, I am hoping I don't get any more notification at 3AM this Saturday night.
Labels:
Infrastructure,
iPhone,
IT,
Linux,
monitoring,
Nagios
Subscribe to:
Comments (Atom)