LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-22-2010, 08:32 AM   #1
LayTech
Member
 
Registered: Jul 2010
Posts: 30

Rep: Reputation: 15
polling interval for nagios


Hi,

i wanna decrease the polling time it takes to check the services..by default it is once every ten minutes. i wanna change it to maybe like seconds? 5-10 secs? hmm, i read from a forum thread which says that to change the polling interval, we would have to change the "normal_check_interval" for services.cfg? but my services.cfg is empty.. so i went to windows.cfg to check for the services defined..

eg. of one of service defined:

define service{
use generic-service
host_name wins xp sp2
service_description SMTP
check_command check_smtp
}

do i have to add "normal_check_interval" for every services defined? or is there a MAIN file in which i can control the overall polling interval for nagios?

thanks
 
Old 07-22-2010, 09:22 AM   #2
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by LayTech View Post
Hi,

i wanna decrease the polling time it takes to check the services..by default it is once every ten minutes. i wanna change it to maybe like seconds? 5-10 secs? hmm, i read from a forum thread which says that to change the polling interval, we would have to change the "normal_check_interval" for services.cfg? but my services.cfg is empty.. so i went to windows.cfg to check for the services defined..

eg. of one of service defined:

define service{
use generic-service
host_name wins xp sp2
service_description SMTP
check_command check_smtp
}

do i have to add "normal_check_interval" for every services defined? or is there a MAIN file in which i can control the overall polling interval for nagios?

thanks
you need to set

Code:
normal_check_interval 1
where you have defined the service.
i think every minute is the best you can get.
 
1 members found this post helpful.
Old 07-22-2010, 10:09 AM   #3
LayTech
Member
 
Registered: Jul 2010
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
you need to set

normal_check_interval 1

where you have defined the service.
i think every minute is the best you can get.
So for each and every service? One by one? Is there like, a main file where we could just set once and it would apply to all? Sorry, i just started on nagios and i know this is a stupid question.

Thanks again (:
 
Old 07-22-2010, 10:16 AM   #4
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by LayTech View Post
So for each and every service? One by one? Is there like, a main file where we could just set once and it would apply to all? Sorry, i just started on nagios and i know this is a stupid question.

Thanks again (:
you can go to the services-templates.cfg and set the option there in the generic-service template.

from there any service using the generic-template inherits this.
 
Old 07-22-2010, 10:17 AM   #5
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
HI LayTech,

Quote:
use generic-service
This option is define service templete.

if you want to set normal_check_interval for all service, change value in template or create new template.
/usr/local/nagios/etc/object/templates.cfg contains templates configuration.

HTH
 
Old 07-22-2010, 10:35 AM   #6
LayTech
Member
 
Registered: Jul 2010
Posts: 30

Original Poster
Rep: Reputation: 15
sorry again.

but, i went to templates.cfg, there isn't anything in there so i have to create new template i suppose.

but how? i still don't get it lol

i just added 'normal_check_interval 1" in templates.cfg..is this it? lol.
and tried to save using :wq (i'm using vi), and it says "/usr/local/nagios/etc/object/templates.cfg" E212: Can't open file for writing"

Last edited by LayTech; 07-22-2010 at 10:48 AM.
 
Old 07-22-2010, 11:05 AM   #7
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
Quote:
sorry again.

but, i went to templates.cfg, there isn't anything in there so i have to create new template i suppose.

but how? i still don't get it lol

i just added 'normal_check_interval 1" in templates.cfg..is this it? lol.
and tried to save using :wq (i'm using vi), and it says "/usr/local/nagios/etc/object/templates.cfg" E212: Can't open file for writing"
post output of below command

ls -l /usr/local/nagios/etc/objects <== location of your nagios configuration

cat templates.cfg
 
Old 07-22-2010, 05:58 PM   #8
LayTech
Member
 
Registered: Jul 2010
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by sem007 View Post
post output of below command

ls -l /usr/local/nagios/etc/objects <== location of your nagios configuration

cat templates.cfg
laytech@ubuntu:~$ ls -l /usr/local/nagios/etc/objects
total 84
-rw-rw-r-- 1 nagios nagios 8357 2010-07-21 00:34 commands.cfg
-rw-r--r-- 1 root root 169 2010-07-20 00:57 contactgroups.cfg
-rw-rw-r-- 1 nagios nagios 2657 2010-07-21 01:03 contacts.cfg
-rw-r--r-- 1 root root 176 2010-07-20 00:21 escalations.cfg
-rw-r--r-- 1 root root 298 2010-07-19 23:49 hostgroups.cfg
-rw-r--r-- 1 root root 405 2010-07-21 02:35 hosts.cfg
-rw-rw-r-- 1 nagios nagios 5470 2010-07-19 18:50 localhost.cfg
-rw-r--r-- 1 root root 0 2010-07-14 23:02 nagios.cfg
-rw-r--r-- 1 root root 0 2010-07-15 19:37 nrpe.cfg
-rw-rw-r-- 1 nagios nagios 3124 2010-07-11 18:12 printer.cfg
-rw-r--r-- 1 root root 0 2010-07-19 23:27 service.cfg
-rw-r--r-- 1 root root 957 2010-07-21 02:14 services.cfg
-rw-rw-r-- 1 nagios nagios 3293 2010-07-11 18:12 switch.cfg
-rw-r--r-- 1 root root 520 2010-07-14 23:17 template.cfg
-rw-rw-r-- 1 nagios nagios 10812 2010-07-20 00:56 templates.cfg
-rw-rw-r-- 1 nagios nagios 3209 2010-07-11 18:12 timeperiods.cfg
-rw-rw-r-- 1 nagios nagios 11207 2010-07-22 01:28 windows.cfg

Last edited by LayTech; 07-22-2010 at 08:07 PM.
 
Old 07-23-2010, 04:53 AM   #9
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
Might be use opened wrong file. ( template.cfg is created by root )

Quote:
-rw-rw-r-- 1 nagios nagios 10812 2010-07-20 00:56 templates.cfg
this is the file which contain default template configuration.

find generic-service template and modify value of
normal_check_interval

HTH
 
Old 07-23-2010, 05:34 AM   #10
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
if you compiled from source then there is a command which would have created sample config files.

Code:
make install-config
 
Old 07-23-2010, 06:08 AM   #11
LayTech
Member
 
Registered: Jul 2010
Posts: 30

Original Poster
Rep: Reputation: 15
@sem007

But the thing is, the templates.cfg file is empty? There isn't anything inside, I only see "~" all over. So i also can't find any generic-service =/


@centosboy

Hmm, yeah. I typed that command before, during the installation for nagios.



But why is it empty in templates.cfg :S
 
Old 07-23-2010, 06:29 AM   #12
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
hmm...

but As per ls command output it seem aprox. 11k size.

Quote:
-rw-r--r-- 1 root root 520 2010-07-14 23:17 template.cfg
-rw-rw-r-- 1 nagios nagios 10812 2010-07-20 00:56 templates.cfg
there is two files. Are you sure you are accessing right file?

or might be something wrong in installation as suggested by centosboy
 
Old 07-23-2010, 06:37 AM   #13
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
this is the file you want


Code:
/usr/local/nagios/etc/objects/templates.cfg
 
Old 07-23-2010, 07:00 AM   #14
LayTech
Member
 
Registered: Jul 2010
Posts: 30

Original Poster
Rep: Reputation: 15
Great, i saw the .cfg file (:

thanks thanks!

By the way, i changed it to '1' instead of the default '10', and i used my stop watch to check how long it will take (by right, it will take 1 min) but i found out it actually took 1.5min? (90 secs). =/

My teacher asked me to set it as low as like 30 seconds? Which is impossible i guess?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Nagios and Oreon (Nagios web front end) installation and Configuration LXer Syndicated Linux News 1 05-31-2016 07:26 AM
Nagios 3.1.2 + RHEL 5.3 You don't have permission to access /nagios/ on this server psix Linux - Server 13 08-04-2015 02:25 AM
Nagios Daemon, PID not found but rc.nagios runs agentc0re Slackware 1 07-03-2007 02:47 PM
LXer: Nagios 2.5 and Oreon 1.3 (Nagios web front end) installation with screenshots LXer Syndicated Linux News 0 08-11-2006 05:33 PM
NTP polling interval in Linux? oswald21 Linux - Networking 1 03-10-2003 03:20 PM


All times are GMT -5. The time now is 04:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration