Page 1 of 1
[SOLVE]nvalid max_attempts, check_interval, retry_interval,
Posted: Wed Feb 24, 2016 8:24 am
by wheely
Hi everybody,
i've this error when trying to verify my nagios.cfg
seems
the template Generic_host is missing
i don't know where i can found Template.cfg this file,doesn't exist on my machine ?
it's not in /nagios/etc/objects/ or elsewhere
could someone explain me how to correct that error
how to put back the default generic service Template. ?
Thanks a lot
Code: Select all
Error processing object config files!
2016-02-24 10:19:31
ERROR
Error: Could not register service (config file '/srv/eyesofnetwork/nagios/etc/objects/services.cfg', starting on line 2335)
2016-02-24 10:19:31
ERROR
Error: Invalid max_attempts, check_interval, retry_interval, or notification_interval value for service 'PGCOM_GRA' on host 'ARC'
2016-02-24 10:19:31
ERROR
Processing object config file '/srv/eyesofnetwork/nagios/etc/objects/hostgroups.cfg'...
2016-02-24 10:19:31
ERROR
Processing object config file '/srv/eyesofnetwork/nagios/etc/objects/timeperiods.cfg'...
2016-02-24 10:19:31
ERROR
Processing object config file '/srv/eyesofnetwork/nagios/etc/objects/commands.cfg'...
2016-02-24 10:19:31
ERROR
Processing object config file '/srv/eyesofnetwork/nagios/etc/objects/contactgroups.cfg'...
Re: Error: Invalid max_attempts, check_interval, retry_inter
Posted: Wed Feb 24, 2016 10:00 am
by eloyd
What OS is this and how was Nagios installed?
Re: Error: Invalid max_attempts, check_interval, retry_inter
Posted: Wed Feb 24, 2016 11:59 am
by wheely
Hi,
Nagios installed with EyesofNetwork 4.2 for Centos
thanks
Re: Error: Invalid max_attempts, check_interval, retry_inter
Posted: Wed Feb 24, 2016 3:35 pm
by jolson
I'm interested in the following output:
Code: Select all
ls -lR /srv/eyesofnetwork/nagios/etc/
Code: Select all
cat /srv/eyesofnetwork/nagios/etc/nagios.cfg
Re: Error: Invalid max_attempts, check_interval, retry_inter
Posted: Thu Feb 25, 2016 2:00 am
by wheely
hi,
this the result of
ls -Lr /srv/eyesofnetwork/nagios/etc
Code: Select all
send_nsca.cfg lilac-backup-02-24-2016-15-38 lilac-backup-02-23-2016-14-59
resource.cfg lilac-backup-02-24-2016-15-35 lilac-backup-02-23-2016-14-57
objects lilac-backup-02-24-2016-15-23 lilac-backup-02-23-2016-14-53
nsca.cfg lilac-backup-02-24-2016-10-19 lilac-backup-02-23-2016-14-46
nagios.cfg lilac-backup-02-23-2016-16-26 lilac-backup-02-23-2016-14-35
lilac-backup-02-24-2016-17-14 lilac-backup-02-23-2016-16-23 lilac-backup-02-23-2016-14-30
lilac-backup-02-24-2016-16-59 lilac-backup-02-23-2016-16-20 lilac-backup-02-23-2016-13-59
lilac-backup-02-24-2016-16-31 lilac-backup-02-23-2016-16-00 lilac-backup-02-23-2016-13-58
lilac-backup-02-24-2016-16-20 lilac-backup-02-23-2016-15-57 lilac-backup-02-23-2016-13-56
lilac-backup-02-24-2016-16-09 lilac-backup-02-23-2016-15-35 cgi.cfg
lilac-backup-02-24-2016-16-08 lilac-backup-02-23-2016-15-32 ..
lilac-backup-02-24-2016-15-40 lilac-backup-02-23-2016-15-17 .
and
the content of my nagios.cfg
Code: Select all
[root@eon ~]# cat /srv/eyesofnetwork/nagios/etc/nagios.cfg
# Written by NagiosMainExporter from Eonweb Configurator 2.4 on February 23, 2016, 1:57 pm
log_file=/srv/eyesofnetwork/nagios/var/log/nagios.log
temp_file=/srv/eyesofnetwork/nagios/var/log/nagios.tmp
status_file=/srv/eyesofnetwork/nagios/var/log/status.dat
status_update_interval=30
nagios_user=nagios
nagios_group=eyesofnetwork
enable_notifications=1
execute_service_checks=1
accept_passive_service_checks=1
enable_event_handlers=1
log_rotation_method=d
log_archive_path=/srv/eyesofnetwork/nagios/var/log/archives
check_external_commands=1
command_check_interval=-1
command_file=/srv/eyesofnetwork/nagios/var/log/rw/nagios.cmd
lock_file=/var/run/nagios.pid
retain_state_information=1
state_retention_file=/srv/eyesofnetwork/nagios/var/log/retention.dat
retention_update_interval=60
use_retained_program_state=1
use_syslog=0
log_notifications=1
log_service_retries=1
log_host_retries=1
log_event_handlers=1
log_initial_states=0
log_external_commands=1
log_passive_checks=1
global_host_event_handler=event-browser-host
global_service_event_handler=event-browser-service
sleep_time=0.25
service_interleave_factor=s
max_concurrent_checks=0
service_reaper_frequency=10
interval_length=60
use_aggressive_host_checking=0
enable_flap_detection=1
low_service_flap_threshold=5
high_service_flap_threshold=20
low_host_flap_threshold=5
high_host_flap_threshold=20
soft_state_dependencies=0
service_check_timeout=240
host_check_timeout=300
event_handler_timeout=180
notification_timeout=120
ocsp_timeout=180
perfdata_timeout=180
obsess_over_services=0
process_performance_data=1
check_for_orphaned_services=0
check_service_freshness=1
date_format=euro
illegal_object_name_chars=`~!$%^&*|\'"<>?,()=
illegal_macro_output_chars=`~$&|\'"<>
admin_email=nagios
admin_pager=pagenagios
execute_host_checks=1
service_inter_check_delay_method=s
use_retained_scheduling_info=0
accept_passive_host_checks=1
max_service_check_spread=30
host_inter_check_delay_method=s
max_host_check_spread=30
auto_reschedule_checks=0
auto_rescheduling_interval=30
auto_rescheduling_window=180
ochp_timeout=180
check_host_freshness=1
host_freshness_check_interval=60
service_freshness_check_interval=60
use_regexp_matching=0
use_true_regexp_matching=0
event_broker_options=-1
daemon_dumps_core=0
host_perfdata_file=/srv/eyesofnetwork/pnp4nagios/var/log/host-perfdata
host_perfdata_file_template=DATATYPE::HOSTPERFDATA TIMET::$TIMET$ HOSTNAME::$HOSTNAME$ HOSTPERFDATA::$HOSTPERFDATA$ HOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$ HOSTSTATE::$HOSTSTATE$ HOSTSTATETYPE::$HOSTSTATETYPE$
service_perfdata_file=/srv/eyesofnetwork/pnp4nagios/var/log/service-perfdata
service_perfdata_file_template=DATATYPE::SERVICEPERFDATA TIMET::$TIMET$ HOSTNAME::$HOSTNAME$ SERVICEDESC::$SERVICEDESC$ SERVICEPERFDATA::$SERVICEPERFDATA$ SERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$ HOSTSTATE::$HOSTSTATE$ HOSTSTATETYPE::$HOSTSTATETYPE$ SERVICESTATE::$SERVICESTATE$ SERVICESTATETYPE::$SERVICESTATETYPE$
host_perfdata_file_mode=a
service_perfdata_file_mode=a
host_perfdata_file_processing_command=process-host-perfdata-file
service_perfdata_file_processing_command=process-service-perfdata-file
host_perfdata_file_processing_interval=15
service_perfdata_file_processing_interval=15
object_cache_file=/srv/eyesofnetwork/nagios/var/log/objects.cache
broker_module=/srv/eyesofnetwork/mk-livestatus/lib/livestatus.o /srv/eyesofnetwork/nagios/var/log/rw/live
broker_module=/srv/eyesofnetwork/nagios/bin/ndomod-3x.o config_file=/srv/eyesofnetwork/ndoutils/ndomod.cfg
resource_file=/srv/eyesofnetwork/nagios/etc/resource.cfg
cfg_dir=/srv/eyesofnetwork/nagios/etc/objects
Re: Error: Invalid max_attempts, check_interval, retry_inter
Posted: Thu Feb 25, 2016 11:43 am
by lmiltchev
What do you have on line 2335 in the '/srv/eyesofnetwork/nagios/etc/objects/services.cfg' file? Can you show us the 'PGCOM_GRA' service definition on host 'ARC'?
Also, run the following command, and show the output:
Code: Select all
ls -la /srv/eyesofnetwork/nagios/etc/objects/
Re: Error: Invalid max_attempts, check_interval, retry_inter
Posted: Fri Feb 26, 2016 3:28 am
by wheely
on line 2335 nothing special
Code: Select all
2335
2336 define service {
2337 host_name ARC
2338 service_description PGCOM_N2
2339 display_name PGCOM_N2
2340 check_command process!PGCOM_N2!85,90!85,90
2341 notes_url
2342 }
if i delete thoses lines that error appear on the next service declared
seems that the file where is defined nvalid max_attempts, check_interval, retry_interval, or notification_interval value for service
can't be parsed or not found
supposely template.cfg but i can't find where thoses things are.
Code: Select all
[root@eon ~]# ls -la /srv/eyesofnetwork/nagios/etc/objects/
total 272
drwxrwxrwx. 2 nagios eyesofnetwork 4096 25 févr. 09:05 .
drwxrwxrwx. 54 nagios eyesofnetwork 4096 25 févr. 17:38 ..
-rwxrwxrwx. 1 nagios eyesofnetwork 13496 23 févr. 13:57 commands.cfg
-rwxrwxrwx. 1 nagios eyesofnetwork 303 23 févr. 13:57 contactgroups.cfg
-rwxrwxrwx. 1 nagios eyesofnetwork 1482 23 févr. 13:57 contacts.cfg
-rwxrwxrwx. 1 nagios eyesofnetwork 98 23 févr. 13:57 dependencies.cfg
-rwxrwxrwx. 1 nagios eyesofnetwork 98 23 févr. 13:57 escalations.cfg
-rwxrwxrwx. 1 nagios eyesofnetwork 1418 23 févr. 13:57 hostgroups.cfg
-rwxrwxrwx. 1 nagios eyesofnetwork 48819 23 févr. 13:57 hosts.cfg
-rwxrwxrwx. 1 nagios eyesofnetwork 934 23 févr. 13:57 servicegroups.cfg
-rwxr-xr-x 1 root root 174079 24 févr. 15:44 services.cfg
-rwxrwxrwx. 1 nagios eyesofnetwork 332 24 févr. 16:15 timeperiods.cfg
[root@eon ~]#
Re: Error: Invalid max_attempts, check_interval, retry_inter
Posted: Fri Feb 26, 2016 1:09 pm
by lmiltchev
I am not familiar with the EyesofNetwork's version of Nagios, but I can see that you don't have max_check_attempts, check_interval, and retry_interval defined in the service config file.
define service {
host_name ARC
service_description PGCOM_N2
display_name PGCOM_N2
check_command process!PGCOM_N2!85,90!85,90
notes_url
}
I don't see a "use" directive, either so these values cannot be inherited from a template. The "templates.cfg" file is missing from the "objects" directory too.
Try this - download the file below, and remove the "*.txt" extension. Place it in the objects directory.
Add the following directive to all of your services:
Verify nagios configuration. If there are no errors, restart nagios.
Hope this helps.
[SOLVED] : Invalid max_attempts, check_interval, retry_inter
Posted: Tue Mar 01, 2016 4:18 am
by wheely
Hi
Thanks for your help everyone

everything works fine now
add to recreate Generic_service, i'even don't know where this file is saved
and had to add it to all my equipment and tweaked a bit the way that nagios verify and export
i even don't understand why that error happened but who care now everything is ok