Page 3 of 4
Re: Basics - Adding a Host to Nagios Core
Posted: Tue Oct 16, 2018 8:08 am
by workid
I have restarted but still have the same error:
could it be something to do with my commands.cfg file? when i try and verify that i get this error:
Code: Select all
admin-it@GC-NAGIOS:/usr/local/nagios/etc/objects$ sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/objects/commands.cfg
Nagios Core 4.4.2
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2018-08-16
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Error in configuration file '/usr/local/nagios/etc/objects/commands.cfg' - Line 26 (NULL value)
Error processing main config file!
Re: Basics - Adding a Host to Nagios Core
Posted: Tue Oct 16, 2018 8:44 am
by scottwilkerson
workid wrote:I have restarted but still have the same error:
What error?
workid wrote:could it be something to do with my commands.cfg file? when i try and verify that i get this error:
You cannot verify individual .cfg files like this, only the nagios.cfg
Re: Basics - Adding a Host to Nagios Core
Posted: Tue Oct 16, 2018 9:43 am
by workid
The error is:
(Return code of 127 is out of bounds. Check if plugin exists)
The plugin definitely exists:
Code: Select all
admin-it@GC-NAGIOS:/usr/local/nagios/libexec$ ls
check_apt check_flexlm check_mailq check_overcr check_time
check_breeze check_ftp check_mrtg check_ping check_udp
check_by_ssh check_hpjd check_mrtgtraf check_pop check_ups
check_clamd check_http check_nagios check_procs check_uptime
check_cluster check_icmp check_ncpa.py check_real check_users
check_dhcp check_ide_smart check_nntp check_rpc check_wave
check_dig check_ifoperstatus check_nt check_sensors negate
check_disk check_ifstatus check_ntp check_smtp urlize
check_disk_smb check_imap check_ntp_peer check_snmp utils.pm
check_dns check_ircd check_ntp_time check_ssh utils.sh
check_dummy check_load check_nwstat check_swap
check_file_age check_log check_oracle check_tcp
I have the check command in the commands file:
define command {
command_name check_ncpa
command_line $USER1$/check_ncpa.py -H $HOSTADDRESS$ $ARG1$
}
Re: Basics - Adding a Host to Nagios Core
Posted: Tue Oct 16, 2018 9:45 am
by scottwilkerson
I asked this earlier but I do not see the plugin in the directory list you just showed
Re: Basics - Adding a Host to Nagios Core
Posted: Tue Oct 16, 2018 10:01 am
by workid
sorry i don't understand... it is in the list i just posted above
Re: Basics - Adding a Host to Nagios Core
Posted: Tue Oct 16, 2018 10:05 am
by workid
Code: Select all
admin-it@GC-NAGIOS:/usr/local/nagios/libexec$ ls
check_apt check_flexlm check_mailq check_overcr check_time
check_breeze check_ftp check_mrtg check_ping check_udp
check_by_ssh check_hpjd check_mrtgtraf check_pop check_ups
check_clamd check_http check_nagios check_procs check_uptime
check_cluster check_icmp [color=#FF0000]check_ncpa.py[/color] check_real check_users
check_dhcp check_ide_smart check_nntp check_rpc check_wave
check_dig check_ifoperstatus check_nt check_sensors negate
check_disk check_ifstatus check_ntp check_smtp urlize
check_disk_smb check_imap check_ntp_peer check_snmp utils.pm
check_dns check_ircd check_ntp_time check_ssh utils.sh
check_dummy check_load check_nwstat check_swap
check_file_age check_log check_oracle check_tcp
Re: Basics - Adding a Host to Nagios Core
Posted: Tue Oct 16, 2018 10:09 am
by scottwilkerson
Sorry I missed it.
Can you share the configuration definition for this host or service that is showing this error?
Re: Basics - Adding a Host to Nagios Core
Posted: Tue Oct 16, 2018 10:17 am
by workid
is this in the ncpa.cfg file?
define host {
host_name NCPA 2 Host
address 172.17.136.147
check_command check_ncpa!-t 'Nagios_Token' -P 5693 -M system/agent_version
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
contacts nagiosadmin
notification_interval 60
notification_period 24x7
notifications_enabled 1
icon_image ncpa.png
statusmap_image ncpa.png
register 1
}
define service {
host_name NCPA 2 Host
service_description CPU Usage
check_command check_ncpa!-t 'Nagios_Token' -P 5693 -M cpu/percent -w 20 -c 40 -q 'aggregate=avg'
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts nagiosadmin
register 1
}
define service {
host_name NCPA 2 Host
service_description Memory Usage
check_command check_ncpa!-t 'Nagios_Token' -P 5693 -M memory/virtual -w 50 -c 80 -u G
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts nagiosadmin
register 1
}
define service {
host_name NCPA 2 Host
service_description Process Count
check_command check_ncpa!-t 'Nagios_Token' -P 5693 -M processes -w 150 -c 200
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts nagiosadmin
register 1
}
Re: Basics - Adding a Host to Nagios Core
Posted: Tue Oct 16, 2018 2:51 pm
by scottwilkerson
What is the name of the host or service that is giving the
(Return code of 127 is out of bounds. Check if plugin exists) error?
also can you run the following so we can verify the plugin has the correct permissions
Code: Select all
ls -al /usr/local/nagios/libexec/check_ncpa.py
Re: Basics - Adding a Host to Nagios Core
Posted: Wed Oct 17, 2018 8:05 am
by workid
Host Name is the default : NCPA 2 Host
Services are:
CPU Usage
Memory Usage
Process Count
Her is the output from the code you asked me to run:
Code: Select all
ls -al /usr/local/nagios/libexec/check_ncpa.py
-rwxrwxr-x 1 nagios nagios 9982 Mar 8 2018 /usr/local/nagios/libexec/check_ncpa.py