[CentOS] configuration of nagios

Woehrle Hartmut SBB CFF FFS (Extern) hartmut.woehrle at sbb.ch
Wed Jul 3 13:43:15 UTC 2013


And for those who don't like editing files, grepping, perling,.... (yes they exist :)
There is nasgiosql (http://www.nagiosql.org/) a graphic web/mysql based tool that helps a lot.
Of course it is better and easier to use, if one has a - at least basic - understanding of the way nagios/icinga works.

Cu
Hartmut


On 07/03/2013 08:14 AM, Scott Robbins wrote:
> On Wed, Jul 03, 2013 at 07:59:38AM -0400, mark wrote:
>> On 07/03/13 05:37, Earl A Ramirez wrote:
>>> On Jul 3, 2013 5:35 PM, "Rolly Aquino" <rolly at xend.com.ph> wrote:
>>>>
>>>>      can i request for configuration of CentOS nagios for 
>>>> moniotoring our servers and switches
>>>>
>>  > What have you done or tried?  Did you check Google?
>>
>> Have you even read the documentation that comes with the package?
> 
> Nagios documentation, as I recall, is pretty poor.  Max had a great 
> wiki article on it, but it's dated.  Still, if you look at the CentOS 
> wiki article, enough of it may be the same for you to get started.
> 
> Once you understand the wiki article, you can probably then begin to 
> work with the nagios documentation, which becomes less obscure once 
> you've gotten a grasp of it.
> 

I'm not sure if it'll help or make things worse, but inline below is a perl script I created to make nagios configuration a bit easier for me.
$LOCATION is a directory you've created and added a line for in nagios.cfg, something like 'cfg_dir=/etc/nagios/auto', then feed in data files that look like:

#hostname,ip:host-type srv-type  :ht:ssh:hts:tcp:tcps:crit,warn
router:linux-server:generic-service:0:0:0:80,443:0
nemesis,1.2.3.4:linux-server:generic-service:0:22:0:3128:0:95,98 -i /dev/sr0
spawn:linux-server:generic-service:80:22:0:53:0:85,95
dengar:linux-server:generic-service:80,8080:0:0:0:0:0

so for the 'nemesis' line, it creates a config for host nemesis, doesn't use DNS, but sets the ip to 1.2.3.4, sets it as a generic linux server, all services as generic, doesn't monitor http (ht set to zero means no monitor), checks ssh on port 22, no https check, does a generic tcp connection check for squid (3128), no ssl tcp checks, and then my own custom file system monitor for space that probably everyone other than me should ignore.

so if you save this file as hosts.example, save the perl script below as 'parse' and run 'perl parse hosts.example' it'd create a nagios host group called 'example' with all these hosts grouped together and their various ports/services setup to be monitored.

I'm sure there are tons of potential pitfalls, and this script should be considered beta at best, but I thought it was useful to me, so maybe it could be for someone else.

oh, and the , configs.   dengar is a good example it's monitoring http
connections on both port 80 and 8080

and as a final note, the standard disclaimer should be understood; I offer this code with no sort of warranty whatsoever.

--
_______________________________________________
CentOS mailing list
CentOS at centos.org
http://lists.centos.org/mailman/listinfo/centos



More information about the CentOS mailing list