linux

nnscfgmaker.sh: a nagios/nsclient++ cfg maker

Posted by Michael Hendrickx on January 28, 2010
code, misc, sysadmin / No Comments

Dear all,

We are in the process of changing the monitoring system on part of our network from Zenoss to Nagios. This is not a Zenoss vs. Nagios debate, as both products are awesome and do the things they are designed for very well. We (Christian and myself) use a combination of Cacti for bandwith monitoring and Zenoss for server and device monitoring. Now, recently we decided to change the latter to Nagios. It is know for its “great deal of flexibility when integrating Nagios into their environment” (Galstad, 2005)

As Zenoss was configured using SNMP Informant to grab information about the MS Windows servers (available disk space, CPU load, etc) and Nagios uses NSClient++; one of the time consuming tasks was getting the client on the server (thank you domain :) ) and configuring each and every server on the Nagios server. I guess there should be some sort of discovery tool for Nagios, but I couldn’t directly find one.

In order to tackle the copy-pasting for a few dozen config files, and to brush up my bash scripting again, I wrote the Nagios Nsclient++ cfg maker, yeah, what’s in a name eh. This client enumerates the target server about what is installed and makes a CFG file based on that. Oh yeah, we’re using nagios with its text files, not the SQL version.

You can download it here (bash script). As it’s GPL’d, feel free to change and redistribute it. As we mainly house HP servers, APC UPS’s and most of them run Windows (for now, evil laugh), so it’s a bit windows/hp minded.

The syntax is very easy, just run the script with the hostname of the server that you want to “enumerate”. Doing that, you’ll have something similar as the output below:

mike@mon:/usr/local/nagios/etc/servers$ ./nnscfgmaker.sh server2
Nagios NSclient++ (check_nt) CFG maker

 + logfile: server2.cfg
 + pinging the server.. ok
 + checking of nsclient++ is installed
 + adding hdd c:\
 + adding hdd e:\
 + adding hdd f:\
 + adding hdd g:\
 + adding hdd h:\
 + adding hdd i:\
 + adding process: MS SQL Server (sqlservr.exe)
 + adding service: Automatic Updates (wuauserv)
 + adding service: DNS Client (DNSCache)
 + adding service: Event Log (Eventlog)
 + adding service: Messenger (Messenger)
 + adding service: Server Service (lanmanserver)
 + adding service: Windows Time (w32time)
 + adding service: SNMP service (SNMP)
 + adding service: HP OpenView Ctrl Service (ovctrl)
 + adding service: Backup Exec Server (BackupExecRPCService)
 + adding service: HP Insight Server Agent (CqMgServ)
 + adding service: HP Insight NIC Agent (CpqNicMgmt)
 + adding service: HP Insight Storage Agent (CqMgStor)
 + adding service: TrendMicro OfficeScan NT Listener (tmlisten)
 + adding service: Trendmicro Antivirus RealTime Scan (ntrtscan)
 - done

mike@mon:/usr/local/nagios/etc/servers$

This creates a files called server2.cfg, which Nagios can read and process.

Hope you like it, let me know if you have any questions or comments.

Take care,
Michael

Ethan Galstad (2005), Nagios. [online] Available from: http://archive.fosdem.org/2005/index/interviews/interviews_galstad.html (Accessed: 28 Jan 2010)

Tags: , , ,

7days bashes on Linux, should stick to normal gossip

Posted by Michael Hendrickx on November 20, 2009
misc / No Comments

7days recently published an article about Valerie Singleton who created a PC for the elderly.

It was a well written, objective article until statements were made which wasn’t researched enough:

The computer runs on Linux – an operating system of such bewildering complexity to anyone outside its inner circle that trained IT experts have been known to weep in frustration at the process of installing a simple programme.

The reason? Linux has so many incarnations that software often has to be manually modified at the time of installation. That means coding. Yep, amateur programming. Scary, huh? Especially if you’re 82 and you’ve never used a computer before.

“Software” to be manually modified during installation is usually done when you set up services, such as dhcpd, sendmail and bind Let’s assume that a 82 year old will not install their own mailserver, or domain. From a Windows point of view, I doubt that many elderly will install a Windows Active Directory at home also. I would recommend Paddy Smith (the article author) not to mix up Interface and internal workings.

It’s like running a car, driving a car (the interface) is relatively easy, especially if it’s an automatic transmission. Start the car, put the transmission in “D” and push the right pedal. A car’s inner workings is a combination of electronics, air/fuel mixes, precise timed ignitions, and a lot more.

You don’t need a wrench to drive a car.
You don’t need to do coding to run an operating system.

I wish that topics highlighted in 7 Days’ articles were well researched before making statements.

In my eyes, Linux interfaces could be very easy for the young, or the elderly. On the EEE PC, Asus could get their Linux interface pretty right, I’m sure the “inner workings” were done by their IT geeks.
asuslinux

Tags: , ,