I share the configuration and two outputs one of the mentioned command and the other one of a problem solving command that I found.
###############################################################################
#
# Services configuration file
#
# Created by: Nagios CCM 2.7.2
# Date: 2019-03-12 16:19:44
# Version: Nagios Core 4.x
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################
define service {
host_name Portal
service_description / Disk Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_disk!-a '-w 20% -c 10% -p /'!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}
define service {
host_name Portal
service_description /boot Disk Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_disk!-a '-w 20% -c 10% -p /boot'!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}
define service {
host_name Portal
service_description /dev Disk Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_disk!-a '-w 20% -c 10% -p /dev'!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}
define service {
host_name Portal
service_description /dev/shm Disk Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_disk!-a '-w 20% -c 10% -p /dev/shm'!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}
define service {
host_name Portal
service_description /home Disk Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_disk!-a '-w 20% -c 10% -p /home'!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}
define service {
host_name Portal
service_description /run Disk Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_disk!-a '-w 20% -c 10% -p /run'!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}
define service {
host_name Portal
service_description /sys/fs/cgroup Disk Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_disk!-a '-w 20% -c 10% -p /sys/fs/cgroup'!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}
define service {
host_name Portal
service_description /usr Disk Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_disk!-a '-w 20% -c 10% -p /usr'!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}
define service {
host_name Portal
service_description /var Disk Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_disk!-a '-w 20% -c 10% -p /var'!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}
define service {
host_name Portal
service_description /var/lib Disk Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_disk!-a '-w 20% -c 10% -p /var/lib'!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}
define service {
host_name Portal
service_description Apache Web Server
use xiwizard_nrpe_service
check_command check_nrpe!check_init_service!-a 'httpd'!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}
define service {
host_name Portal
service_description CPU Stats
use xiwizard_nrpe_service
check_command check_nrpe!check_cpu_stats!-a '-w 85 -c 95'!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}
define service {
host_name Portal
service_description Cron Scheduling Daemon
use xiwizard_nrpe_service
check_command check_nrpe!check_init_service!-a 'crond'!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}
define service {
host_name Portal
service_description HTTP
use xiwizard_website_http_service
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard autodiscovery
register 1
}
define service {
host_name Portal
service_description HTTPS
use xiwizard_website_http_service
check_command check_xi_service_http!-S!!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard autodiscovery
register 1
}
define service {
host_name Portal
service_description Load
use xiwizard_nrpe_service
check_command check_nrpe!check_load!-a '-w 15,10,5 -c 30,20,10'!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}
define service {
host_name Portal
service_description Memory Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_mem!-a '-w 20 -c 10'!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}
define service {
host_name Portal
service_description Ping
use xiwizard_linuxserver_ping_service
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}
define service {
host_name Portal
service_description SSH
use xiwizard_ssh_service
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard autodiscovery
register 1
}
define service {
host_name Portal
service_description SSH Server
use xiwizard_nrpe_service
check_command check_nrpe!check_init_service!-a 'sshd'!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}
define service {
host_name Portal
service_description Swap Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_swap!-a '-w 50% -c 20%'!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}
define service {
host_name Portal
service_description TCP Port 10000 - ndmp
use xiwizard_tcp_service
check_command check_xi_service_tcp!-p 10000!!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard autodiscovery
register 1
}
define service {
host_name Portal
service_description Total Processes
use xiwizard_nrpe_service
check_command check_nrpe!check_procs!-a '-w 370 -c 380'!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}
define service {
host_name Portal
service_description Users
use xiwizard_nrpe_service
check_command check_nrpe!check_users!-a '-w 5 -c 10'!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}
define service {
host_name Portal
service_description _portal_ URL Status
use xiwizard_website_http_service
check_command check_xi_service_http! -f ok -I 172.18.175.211 -u '/portal/' -S -p 443!!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard websiteurl
register 1
}
define service {
host_name Portal
service_description _SuiteCRM_index.php URL Status
use xiwizard_website_http_service
check_command check_xi_service_http! -f ok -I 172.18.175.211 -u '/SuiteCRM/index.php?action=Login&module=Users' -S -p 443!!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
notifications_enabled 1
contacts nagiosadmin
_xiwizard websiteurl
register 1
}
###############################################################################
#
# Services configuration file
#
# END OF FILE
#
###############################################################################
command 1
[root@nagiosxi ~]# ls -al /usr/local/nagios/etc/import
total 12
drwxrwxr-x. 2 apache nagios 4096 Mar 12 15:50 .
drwxrwxr-x. 8 apache nagios 4096 Mar 12 15:50 ..
-rw-rw-r-- 1 apache nagios 418 Feb 25 14:52 192.168.30.30.cfg
command 2
[nagios@nagiosxi scripts]$ ./reconfigure_nagios.sh
PHP Warning: PHP Startup: SourceGuardian: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0
--- reset_config_perms.sh ------------
> Setting CCM script permissions
> Setting script permissions
> Setting special component script permissions
> Setting configuration file/directory permissions
> Setting perfdata directory and RRD permissions
> Setting NOM checkpoint user:group permissions
> + Setting CCM configuration file user:group permissions
> + Setting Recurring Downtime file user:group permissions
> + Setting BPI configuration file user:group permissions
--------------------------------------
PHP Warning: PHP Startup: SourceGuardian: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0
--- ccm_import.php -------------------
> Setting import directory: /usr/local/nagios/etc/import/
> Importing config files into the CCM
- Importing: /usr/local/nagios/etc/import/192.168.30.30.cfg .. PHP Warning: PHP Startup: SourceGuardian: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0
ERROR
<b>_box: Size query of C:check_command check_file_size_age!-C 'ssh nagios@$HOSTADDRESS$ ls -lA C:\' -F '[^\0]+' -r! -s 2MB,4MB</b> - You must enter a proper service_description. You can not use the characters: \~!$%^&*"'|<>?()=
--------------------------------------
Importing into the CCM failed!
[nagios@nagiosxi scripts]$ nano /usr/local/nagios/etc/import/192.168.30.30.cfg
[nagios@nagiosxi scripts]$ rm -rf /usr/local/nagios/etc/import/192.168.30.30.cfg
[nagios@nagiosxi scripts]$ ./reconfigure_nagios.sh
PHP Warning: PHP Startup: SourceGuardian: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0
--- reset_config_perms.sh ------------
> Setting CCM script permissions
> Setting script permissions
> Setting special component script permissions
> Setting configuration file/directory permissions
> Setting perfdata directory and RRD permissions
> Setting NOM checkpoint user:group permissions
> + Setting CCM configuration file user:group permissions
> + Setting Recurring Downtime file user:group permissions
> + Setting BPI configuration file user:group permissions
--------------------------------------
PHP Warning: PHP Startup: SourceGuardian: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0
--- ccm_import.php -------------------
> Setting import directory: /usr/local/nagios/etc/import/
> Importing config files into the CCM
No files to import
--------------------------------------
PHP Warning: PHP Startup: SourceGuardian: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0
--- ccm_export.php -------------------
> Writing CCM configuration to Nagios files
PHP Warning: PHP Startup: SourceGuardian: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0
Finished writing out configuraton
--------------------------------------
--------------------------------------
> Verifying configuration with Nagios Core
> Output:
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...
Read main config file okay...
Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/Portal.cfg', starting on line 413)
Error processing object config files!
***> One or more problems was encountered while processing the config files...
Check your configuration file(s) to ensure that they contain valid
directives and data definitions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.
> Return Code: 1
--------------------------------------
PHP Warning: PHP Startup: SourceGuardian: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0
/usr/local/nagiosxi/nom/checkpoints/nagioscore/errors /usr/local/nagiosxi/scripts
tar: Removing leading `/' from member names
/usr/local/nagiosxi/scripts
LATEST NOM SNAPSHOT: /usr/local/nagiosxi/nom/checkpoints/nagioscore/1552339166.tar.gz
/ /usr/local/nagiosxi/scripts
RESTORING NOM SNAPSHOT : /usr/local/nagiosxi/nom/checkpoints/nagioscore/1552339166.tar.gz
tar: usr/local/nagios/etc/hosts: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/import: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/nrpe: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/pnp/pages: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/pnp/check_commands: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/pnp: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/services: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/static: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc: Cannot utime: Operation not permitted
tar: Exiting with failure status due to previous errors
/usr/local/nagiosxi/scripts
PHP Warning: PHP Startup: SourceGuardian: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0
--- reset_config_perms.sh ------------
> Setting CCM script permissions
> Setting script permissions
> Setting special component script permissions
> Setting configuration file/directory permissions
> Setting perfdata directory and RRD permissions
> Setting NOM checkpoint user:group permissions
> + Setting CCM configuration file user:group permissions
> + Setting Recurring Downtime file user:group permissions
> + Setting BPI configuration file user:group permissions
--------------------------------------
[nagios@nagiosxi scripts]$ ./reconfigure_nagios.sh
PHP Warning: PHP Startup: SourceGuardian: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0
--- reset_config_perms.sh ------------
> Setting CCM script permissions
> Setting script permissions
> Setting special component script permissions
> Setting configuration file/directory permissions
> Setting perfdata directory and RRD permissions
> Setting NOM checkpoint user:group permissions
> + Setting CCM configuration file user:group permissions
> + Setting Recurring Downtime file user:group permissions
> + Setting BPI configuration file user:group permissions
--------------------------------------
PHP Warning: PHP Startup: SourceGuardian: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0
--- ccm_import.php -------------------
> Setting import directory: /usr/local/nagios/etc/import/
> Importing config files into the CCM
- Importing: /usr/local/nagios/etc/import/192.168.30.30.cfg .. PHP Warning: PHP Startup: SourceGuardian: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0
ERROR
<b>_box: Size query of C:check_command check_file_size_age!-C 'ssh nagios@$HOSTADDRESS$ ls -lA C:\' -F '[^\0]+' -r! -s 2MB,4MB</b> - You must enter a proper service_description. You can not use the characters: \~!$%^&*"'|<>?()=
--------------------------------------
Importing into the CCM failed!
[nagios@nagiosxi scripts]$
[nagios@nagiosxi scripts]$
[nagios@nagiosxi scripts]$ ./reconfigure_nagios.sh
PHP Warning: PHP Startup: SourceGuardian: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0
--- reset_config_perms.sh ------------
> Setting CCM script permissions
> Setting script permissions
> Setting special component script permissions
> Setting configuration file/directory permissions
> Setting perfdata directory and RRD permissions
> Setting NOM checkpoint user:group permissions
> + Setting CCM configuration file user:group permissions
> + Setting Recurring Downtime file user:group permissions
> + Setting BPI configuration file user:group permissions
--------------------------------------
PHP Warning: PHP Startup: SourceGuardian: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0
--- ccm_import.php -------------------
> Setting import directory: /usr/local/nagios/etc/import/
> Importing config files into the CCM
- Importing: /usr/local/nagios/etc/import/192.168.30.30.cfg .. PHP Warning: PHP Startup: SourceGuardian: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0
ERROR
<b>_box: Size query of C:check_command check_file_size_age!-C 'ssh nagios@$HOSTADDRESS$ ls -lA C:\' -F '[^\0]+' -r! -s 2MB,4MB</b> - You must enter a proper service_description. You can not use the characters: \~!$%^&*"'|<>?()=
--------------------------------------
Importing into the CCM failed!