Page 1 of 1

Nagios 4 upgrade from 3.5.0

Posted: Mon Sep 23, 2013 2:15 pm
by embegee
Server=Centos 6.4 32 bit

I have compiled and upgraded my existing 3.5 install to 4.0, retaining my existing configuration files.

I have a host and service definitions that call entries form templates.cfg and in turn my nested pnp4nagios entries (all listed below)
Any suggestions for the following would be greatly appreciated.

My initial -v check gave me..

Code: Select all

Reading configuration data...
Warning: use_embedded_perl_implicitly is deprecated and will be removed.
Warning: enable_embedded_perl is deprecated and will be removed.
Warning: p1_file is deprecated and will be removed.
Warning: sleep_time is deprecated and will be removed.
Warning: external_command_buffer_slots is deprecated and will be removed. All commands are always processed upon arrival
Warning: command_check_interval is deprecated and will be removed. Commands are always handled on arrival
I have removed these entries from nagios.cfg but now am getting...
Error: Service has no hosts and/or service_description (config file '/nagios/etc/objects/templates.cfg', starting on line 29)
Error processing object config files!

Config files are :

Code: Select all

hosts.cfg
define host{
host_name               lvicicstb91
alias                   lvicicstb91
parents			test1
address                 10.67.138.10
use			VIHARHELHOST
}
define host{
host_name               lvicicstb92
alias                   lvicicstb92
parents			test1
address                 10.67.138.11
use			VIHARHELHOST
}
define host{
host_name               test1
alias                   NagiosHost
use                     VIHAHOST            
address                 127.0.0.1
}
services.cfg

Code: Select all

define host{
host_name               lvicicstb91
alias                   lvicicstb91
parents			test1
address                 10.67.138.10
use			VIHARHELHOST
}
define host{
host_name               lvicicstb92
alias                   lvicicstb92
parents			test1
address                 10.67.138.11
use			VIHARHELHOST
}
define host{
host_name               test1
alias                   NagiosHost
use                     VIHAHOST            
address                 127.0.0.1
}
templates.cfg

Code: Select all

define host{
host_name               lvicicstb91
alias                   lvicicstb91
parents			test1
address                 10.67.138.10
use			VIHARHELHOST
}
define host{
host_name               lvicicstb92
alias                   lvicicstb92
parents			test1
address                 10.67.138.11
use			VIHARHELHOST
}
define host{
host_name               test1
alias                   NagiosHost
use                     VIHAHOST            
address                 127.0.0.1
}
Nagios Log entries

Code: Select all

[1379957781] Nagios 4.0.0 starting... (PID=11999)
[1379957781] Local time is Mon Sep 23 10:36:21 PDT 2013
[1379957781] LOG VERSION: 2.0
[1379957781] qh: Socket '/nagios/var/rw/nagios.qh' successfully initialized
[1379957781] qh: core query handler registered
[1379957781] nerd: Channel hostchecks registered successfully
[1379957781] nerd: Channel servicechecks registered successfully
[1379957781] nerd: Channel opathchecks registered successfully
[1379957781] nerd: Fully initialized and ready to rock!
[1379957781] wproc: Successfully registered manager as @wproc with query handler
[1379957781] wproc: Registry request: name=Core Worker 12001;pid=12001
[1379957781] wproc: Registry request: name=Core Worker 12002;pid=12002
[1379957781] wproc: Registry request: name=Core Worker 12004;pid=12004
[1379957781] wproc: Registry request: name=Core Worker 12003;pid=12003
[1379957781] Successfully launched command file worker with pid 12005
[1379957869] Caught SIGTERM, shutting down...
[1379957869] Successfully shutdown... (PID=11999)
[1379957869] Event broker module 'NERD' deinitialized successfully.
[1379957870] Nagios 4.0.0 starting... (PID=12072)
[1379957870] Local time is Mon Sep 23 10:37:50 PDT 2013
[1379957870] LOG VERSION: 2.0
[1379957870] qh: Socket '/nagios/var/rw/nagios.qh' successfully initialized
[1379957870] qh: core query handler registered
[1379957870] nerd: Channel hostchecks registered successfully
[1379957870] nerd: Channel servicechecks registered successfully
[1379957870] nerd: Channel opathchecks registered successfully
[1379957870] nerd: Fully initialized and ready to rock!
[1379957870] wproc: Successfully registered manager as @wproc with query handler
[1379957870] wproc: Registry request: name=Core Worker 12074;pid=12074
[1379957870] wproc: Registry request: name=Core Worker 12076;pid=12076
[1379957870] wproc: Registry request: name=Core Worker 12075;pid=12075
[1379957870] wproc: Registry request: name=Core Worker 12077;pid=12077
[1379957870] Successfully launched command file worker with pid 12078
[1379957893] SERVICE ALERT: localhost;HTTP;WARNING;SOFT;1;HTTP WARNING: HTTP/1.1 403 Forbidden - 5237 bytes in 0.029 second response time
[1379957953] SERVICE ALERT: localhost;HTTP;WARNING;SOFT;2;HTTP WARNING: HTTP/1.1 403 Forbidden - 5237 bytes in 0.004 second response time
[1379958013] SERVICE ALERT: localhost;HTTP;WARNING;SOFT;3;HTTP WARNING: HTTP/1.1 403 Forbidden - 5237 bytes in 0.005 second response time
[1379958073] SERVICE ALERT: localhost;HTTP;WARNING;HARD;4;HTTP WARNING: HTTP/1.1 403 Forbidden - 5237 bytes in 0.011 second response time
[1379958755] Caught SIGTERM, shutting down...
[1379958755] Successfully shutdown... (PID=12072)
[1379958755] Event broker module 'NERD' deinitialized successfully.

Re: Nagios 4 upgrade from 3.5.0

Posted: Mon Sep 23, 2013 3:22 pm
by abrist
embegee wrote: I have removed these entries from nagios.cfg but now am getting...
Error: Service has no hosts and/or service_description (config file '/nagios/etc/objects/templates.cfg', starting on line 29)
Error processing object config files!
Could you post the full contents of /nagios/etc/objects/templates.cfg in code wraps ?

Re: Nagios 4 upgrade from 3.5.0

Posted: Mon Sep 23, 2013 5:30 pm
by embegee

Code: Select all

define host{
name                    VIHARHELHOST
use                     host-pnp
normal_check_interval   5
retry_check_interval    1
max_check_attempts      10
notification_interval   45
check_period            24x7
check_command           check-host-alive
notification_period     24x7
notification_options    d,u,r
notifications_enabled   1
contact_groups          admins
}
define host{
name                    VIHAHOST
use                     host-pnp
normal_check_interval   5
retry_check_interval    1
max_check_attempts      10
notification_interval   45
check_period            24x7
check_command           check-host-alive
notification_period     24x7
notification_options    d,u,r
notifications_enabled   1
contact_groups          admins
}
define service{
name                    VIHASERVICE
use                     srv-pnp
is_volatile             0
max_check_attempts      10
normal_check_interval   5
retry_check_interval    1
check_period            24x7
notification_interval   240
notifications_enabled   1
notification_period     24x7
notification_options    w,c,r
contact_groups          admins
}
define host {
   name       host-pnp
   action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_' class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=_HOST_
   register   0
}
define service {
   name       srv-pnp
   action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$' class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=$SERVICEDESC$
   register   0
}

Re: Nagios 4 upgrade from 3.5.0

Posted: Tue Sep 24, 2013 9:38 am
by abrist
embegee wrote:define service{
name VIHASERVICE
use srv-pnp
is_volatile 0
max_check_attempts 10
normal_check_interval 5
retry_check_interval 1
check_period 24x7
notification_interval 240
notifications_enabled 1
notification_period 24x7
notification_options w,c,r
contact_groups admins
}
The above section, as it is a service, needs a "service description" directive.

Re: Nagios 4 upgrade from 3.5.0

Posted: Tue Sep 24, 2013 1:31 pm
by embegee
These files worked fine in 3.5.0. Is this now a requirement of V4.0 ?

I assumed that Service Description would be taken from the associated definition in the services.cfg file ?

i.e.

Code: Select all

define service{
host_name                  xyz
service_description     FILESYSTEM ROOT
check_command          check_nrpe_viha!check_root
use                             VIHASERVICE
}

Re: Nagios 4 upgrade from 3.5.0

Posted: Tue Sep 24, 2013 1:46 pm
by abrist
Was this definition meant to be a template? If so, you will need to add "register 0" to the service definition.

Re: Nagios 4 upgrade from 3.5.0

Posted: Tue Sep 24, 2013 3:03 pm
by embegee
Thanks abrist !! :)

That was it, the issue is now resolved.