Configurations failed to write to file.

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
almanasra2005
Posts: 3
Joined: Fri May 27, 2016 2:11 pm

Configurations failed to write to file.

Post by almanasra2005 »

An error occurred while attempting to apply your configuration to Nagios Core. Monitoring engine configuration files have been rolled back to their last known good checkpoint.

Error: Command name of command line is NULL
Error: Could not register command (config file '/usr/local/nagios/etc/commands.cfg', starting on line 276)

http://nagiosxi/admin/coreconfigsnapshots.php


Nagios Core 4.1.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-19-2015
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Command name of command line is NULL
Error: Could not register command (config file '/usr/local/nagios/etc/commands.cfg', starting on line 276)
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 defintions. 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.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Configurations failed to write to file.

Post by hsmith »

Error: Could not register command (config file '/usr/local/nagios/etc/commands.cfg', starting on line 276)
Can you check line 276 of that file and post what is there?
Former Nagios Employee.
me.
almanasra2005
Posts: 3
Joined: Fri May 27, 2016 2:11 pm

Re: Configurations failed to write to file.

Post by almanasra2005 »

Code: Select all

command_name                             check_xi_service_ftp
       command_line                             $USER1$/check_ftp -H $HOSTADDRESS$ $ARG1$
}

define command {
       command_name                             check_xi_service_hpjd
       command_line                             $USER1$/check_hpjd -H $HOSTADDRESS$ -C $ARG1$
}

define command {
       command_name                             check_xi_service_http
       command_line                             $USER1$/check_http -H $HOSTADDRESS$ $ARG1$
}

define command {
       command_name                             check_xi_service_http_cert
       command_line                             $USER1$/check_http -H $HOSTADDRESS$ -C $ARG1$
}

define command {
       command_name                             check_xi_service_http_content
       command_line                             $USER1$/check_http -H $HOSTADDRESS$ --onredirect=follow -s "$ARG1$"
}

define command {
       command_name                             check_xi_service_ifoperstatus
       command_line                             $USER1$/check_ifoperstatus -H $HOSTADDRESS$ -C $ARG1$ -k $ARG2$ $ARG3$
}

define command {
       command_name                             check_xi_service_ifoperstatusnag
       command_line                             $USER1$/check_ifoperstatnag $ARG1$ $ARG2$ $HOSTADDRESS$
}

define command {
       command_name                             check_xi_service_imap
       command_line                             $USER1$/check_imap -H $HOSTADDRESS$ $ARG1$
}

define command {
       command_name                             check_xi_service_ldap
       command_line                             $USER1$/check_ldap -H $HOSTADDRESS$ $ARG1$
}

define command {
       command_name                             check_xi_service_mrtgtraf
       command_line                             $USER1$/check_rrdtraf -f /var/lib/mrtg/$ARG1$ -w $ARG2$ -c $ARG3$ -l $ARG4$
}

define command {
       command_name                             check_xi_service_nagioslogserver
       command_line                             $USER1$/check_nagioslogserver.php $ARG1$
}

define command {
       command_name                             check_xi_service_none
       command_line                             $USER1$/check_dummy 0 "Nothing to monitor"
}

define command {
       command_name                             check_xi_service_nsclient
       command_line                             $USER1$/check_nt -H $HOSTADDRESS$ -s "$ARG1$" -p 12489 -v $ARG2$ $ARG3$ $ARG4$
}

define command {
       command_name                             check_xi_service_ping
       command_line                             $USER1$/check_icmp -H $HOSTADDRESS$ -w $ARG1$,$ARG2$ -c $ARG3$,$ARG4$ -p 5
}

define command {
       command_name                             check_xi_service_pop
       command_line                             $USER1$/check_pop -H $HOSTADDRESS$ $ARG1$
}

define command {
       command_name                             check_xi_service_smtp
       command_line                             $USER1$/check_smtp -H $HOSTADDRESS$ $ARG1$
}

define command {
       command_name                             check_xi_service_snmp
       command_line                             $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
}

define command {
       command_name                             check_xi_service_snmp_linux_load
       command_line                             $USER1$/check_snmp_load_wizard.pl -H $HOSTADDRESS$ $ARG1$
}

define command {
       command_name                             check_xi_service_snmp_linux_process
       command_line                             $USER1$/check_snmp_process_wizard.pl -H $HOSTADDRESS$ $ARG1$
}

define command {
       command_name                             check_xi_service_snmp_linux_storage
       command_line                             $USER1$/check_snmp_storage_wizard.pl -H $HOSTADDRESS$ $ARG1$
}

define command {
       command_name                             check_xi_service_snmp_watchguard
       command_line                             $USER1$/check_snmp_generic.pl -H $HOSTADDRESS$ $ARG1$
}

define command {
       command_name                             check_xi_service_snmp_win_load
       command_line                             $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ $ARG1$
}

define command {
       command_name                             check_xi_service_snmp_win_process
       command_line                             $USER1$/check_snmp_process.pl -H $HOSTADDRESS$ $ARG1$
}

define command {
       command_name                             check_xi_service_snmp_win_service
       command_line                             $USER1$/check_snmp_win.pl -H $HOSTADDRESS$ $ARG1$
}

define command {
       command_name                             check_xi_service_snmp_win_storage
       command_line                             $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ $ARG1$
}

define command {
       command_name                             check_xi_service_ssh
       command_line                             $USER1$/check_ssh $ARG1$ $HOSTADDRESS$
}

define command {
       command_name                             check_xi_service_status
       command_line                             sudo /usr/local/nagiosxi/scripts/manage_services.sh status $ARG1$
}

define command {
       command_name                             check_xi_service_tcp
       command_line                             $USER1$/check_tcp -H $HOSTADDRESS$ $ARG1$
}

define command {
       command_name                             check_xi_service_udp
       command_line                             $USER1$/check_udp -H $HOSTADDRESS$ $ARG1$
}

define command {
       command_name                             check_xi_service_webinject
       command_line                             $USER1$/check_webinject.sh $ARG1$
}

define command {
       command_name                             check_xi_service_wmiplus
       command_line                             $USER1$/check_wmi_plus.pl -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -m $ARG3$ $ARG4$
}

define command {
       command_name                             check_xi_service_wmiplus_authfile
       command_line                             $USER1$/check_wmi_plus.pl -H $HOSTADDRESS$ -A $ARG1$ -m $ARG2$ $ARG3$
}

define command {
       command_name                             check_xi_sla
       command_line                             $USER1$/check_xisla.php $ARG1$
}

define command {
       command_name                             notify-host-by-email
       command_line                             /usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
}

define command {
       command_name                             notify-service-by-email
       command_line                             /usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}

define command {
       command_name                             process-host-perfdata-file-bulk
       command_line                             /bin/mv /usr/local/nagios/var/host-perfdata /usr/local/nagios/var/spool/xidpe/$TIMET$.perfdata.host
}

define command {
       command_name                             process-host-perfdata-file-pnp-bulk
       command_line                             /bin/mv /usr/local/nagios/var/host-perfdata /usr/local/nagios/var/spool/perfdata/host-perfdata.$TIMET$
}

define command {
       command_name                             process-host-perfdata-pnp-normal
       command_line                             /usr/bin/perl /usr/local/nagios/libexec/process_perfdata.pl -d HOSTPERFDATA
}

define command {
       command_name                             process-service-perfdata-file-bulk
       command_line                             /bin/mv /usr/local/nagios/var/service-perfdata /usr/local/nagios/var/spool/xidpe/$TIMET$.perfdata.service
}

define command {
       command_name                             process-service-perfdata-file-pnp-bulk
       command_line                             /bin/mv /usr/local/nagios/var/service-perfdata /usr/local/nagios/var/spool/perfdata/service-perfdata.$TIMET$
}

define command {
       command_name                             process-service-perfdata-pnp-normal
       command_line                             /usr/bin/perl /usr/local/nagios/libexec/process_perfdata.pl
}

define command {
       command_name                             vmware_cluster_cpu_usage
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Cluster_CPU_Usage --cluster \"$ARG3$\" --reporting_si \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_cluster_drs
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Cluster_DRS_Status --cluster \"$ARG3$\" --drs_state \"$ARG4$\" --drs_automation_level \"$ARG5$\" --drs_dpm_level \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_cluster_ha
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Cluster_HA_Status --cluster \"$ARG3$\" --ha_state \"$ARG4$\" --ha_host_monitoring \"$ARG5$\" --ha_admission_control \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_cluster_memory_usage
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Cluster_Memory_Usage --cluster \"$ARG3$\" --reporting_si \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_datastore_performance_esx
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Datastore_Performance --name \"$ARG3$\" --reporting_si \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_datastore_performance_vcenter
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Datastore_Performance --host \"$ARG3$\" --name \"$ARG4$\" --reporting_si \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_datastore_performance_vcenter_wac
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Datastore_Performance --host \"$ARG3$\" --name \"$ARG4$\" --reporting_si \"$ARG5$\" --warning \"$ARG6$\" --critical \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_datastore_usage
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Datastore_Usage --name \"$ARG3$\" --reporting_si \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_guest_cpu_info
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Guest_CPU_Info --guest \"$ARG3$\" --reporting_si \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_guest_cpu_usage
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Guest_CPU_Usage --guest \"$ARG3$\" --reporting_si \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_guest_disk_performance
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Guest_Disk_Performance --guest \"$ARG3$\" --reporting_si \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_guest_disk_usage
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Guest_Disk_Usage --guest \"$ARG3$\" --reporting_si \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_guest_memory_info
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Guest_Memory_Info --guest \"$ARG3$\" --reporting_si \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_guest_memory_usage
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Guest_Memory_Usage --guest \"$ARG3$\" --reporting_si \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_guest_nic_usage
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Guest_NIC_Usage --guest \"$ARG3$\" --reporting_si \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_guest_snapshot
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Guest_Snapshot \"$ARG3$\" \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_host_esx_hba_usage
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Host_Storage_Adapter_Performance --name \"$ARG3$\" --reporting_si \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_host_esx_pnic_status
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Host_pNIC_Status --nic_state \"$ARG3$\" --nic_duplex \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_host_esx_pnic_usage
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Host_pNIC_Usage --reporting_si \"$ARG3$\" \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_host_esx_pnic_usage_named
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Host_pNIC_Usage --reporting_si \"$ARG3$\" --name \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_host_esx_switch_status
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Host_Switch_Status --nic_state \"$ARG3$\" --nic_duplex \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_host_esx_switch_status_mtu
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Host_Switch_Status --nic_state \"$ARG3$\" --nic_duplex \"$ARG4$\" --mtu \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_host_esx_switch_status_mtu_named
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Host_Switch_Status --name \"$ARG3$\" --nic_state \"$ARG4$\" --nic_duplex \"$ARG5$\" --mtu \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_host_esx_switch_status_named
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Host_Switch_Status --name \"$ARG3$\" --nic_state \"$ARG4$\" --nic_duplex \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_host_vcenter
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check \"$ARG3$\" --host \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_host_vcenter_cpu_usage
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Host_CPU_Usage --host \"$ARG3$\" --reporting_si \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_host_vcenter_hba_usage
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Host_Storage_Adapter_Performance --host \"$ARG3$\" --name \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_host_vcenter_hba_usage_wac
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Host_Storage_Adapter_Performance --host \"$ARG3$\" --name \"$ARG4$\" --reporting_si \"$ARG5$\" --warning \"$ARG6$\" --critical \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_host_vcenter_memory_usage
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Host_Memory_Usage --host \"$ARG3$\" --reporting_si \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_host_vcenter_pnic_status
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Host_pNIC_Status --host \"$ARG3$\" --nic_state \"$ARG4$\" --nic_duplex \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_host_vcenter_pnic_status_named
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Host_pNIC_Status --host \"$ARG3$\" --name \"$ARG4$\" --nic_state \"$ARG5$\" --nic_duplex \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_host_vcenter_pnic_usage
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Host_pNIC_Usage --host \"$ARG3$\" --reporting_si \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_host_vcenter_pnic_usage_wac
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Host_pNIC_Usage --host \"$ARG3$\" --reporting_si \"$ARG4$\" --warning \"$ARG5$\" --critical \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_host_vcenter_switch_status
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Host_Switch_Status --host \"$ARG3$\" --nic_state \"$ARG4$\" --nic_duplex \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_host_vcenter_switch_status_mtu_1500
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Host_Switch_Status --host \"$ARG3$\" --nic_state \"$ARG4$\" --nic_duplex \"$ARG5$\" --mtu 1500 \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_host_vcenter_switch_status_mtu_1500_named
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Host_Switch_Status --host \"$ARG3$\" --name \"$ARG4$\" --nic_state \"$ARG5$\" --nic_duplex \"$ARG6$\" --mtu 1500 \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_host_vcenter_switch_status_mtu_9000
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Host_Switch_Status --host \"$ARG3$\" --name \"$ARG4$\" --nic_state \"$ARG5$\" --nic_duplex \"$ARG6$\" --mtu 9000 \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_host_vcenter_switch_status_mtu_9000_named
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Host_Switch_Status --host \"$ARG3$\" --nic_state \"$ARG4$\" --nic_duplex \"$ARG5$\" --mtu 9000 \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_host_vcenter_switch_status_named
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Host_Switch_Status --host \"$ARG3$\" --name \"$ARG4$\" --nic_state \"$ARG5$\" --nic_duplex \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_universal
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check \"$ARG3$\" \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             vmware_universal_reporting_si
       command_line                             $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check \"$ARG3$\" --reporting_si \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}

define command {
       command_name                             xi_host_event_handler
       command_line                             /usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_event.php --handler-type=host --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --lasthoststate=$LASTHOSTSTATE$ --lasthoststateid=$LASTHOSTSTATEID$ --hoststatetype=$HOSTSTATETYPE$ --currentattempt=$HOSTATTEMPT$ --maxattempts=$MAXHOSTATTEMPTS$ --hosteventid=$HOSTEVENTID$ --hostproblemid=$HOSTPROBLEMID$ --hostoutput="$HOSTOUTPUT$" --longhostoutput="$LONGHOSTOUTPUT$" --hostdowntime=$HOSTDOWNTIME$
}

define command {
       command_name                             xi_host_notification_handler
       command_line                             /usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=host --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments="$NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hostdisplayname="$HOSTDISPLAYNAME$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --lasthoststate=$LASTHOSTSTATE$ --lasthoststateid=$LASTHOSTSTATEID$ --hoststatetype=$HOSTSTATETYPE$ --currentattempt=$HOSTATTEMPT$ --maxattempts=$MAXHOSTATTEMPTS$ --hosteventid=$HOSTEVENTID$ --hostproblemid=$HOSTPROBLEMID$ --hostoutput="$HOSTOUTPUT$" --longhostoutput="$LONGHOSTOUTPUT$" --datetime="$LONGDATETIME$"
}

define command {
       command_name                             xi_service_event_handler
       command_line                             /usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_event.php --handler-type=service --host="$HOSTNAME$" --service="$SERVICEDESC$" --hostaddress="$HOSTADDRESS$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --hosteventid=$HOSTEVENTID$ --hostproblemid=$HOSTPROBLEMID$ --servicestate=$SERVICESTATE$ --servicestateid=$SERVICESTATEID$ --lastservicestate=$LASTSERVICESTATE$ --lastservicestateid=$LASTSERVICESTATEID$ --servicestatetype=$SERVICESTATETYPE$ --currentattempt=$SERVICEATTEMPT$ --maxattempts=$MAXSERVICEATTEMPTS$ --serviceeventid=$SERVICEEVENTID$ --serviceproblemid=$SERVICEPROBLEMID$ --serviceoutput="$SERVICEOUTPUT$" --longserviceoutput="$LONGSERVICEOUTPUT$" --servicedowntime=$SERVICEDOWNTIME$
}

define command {
       command_name                             xi_service_notification_handler
       command_line                             /usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=service --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments="$NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hostdisplayname="$HOSTDISPLAYNAME$" --service="$SERVICEDESC$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --servicestate=$SERVICESTATE$ --servicestateid=$SERVICESTATEID$ --lastservicestate=$LASTSERVICESTATE$ --lastservicestateid=$LASTSERVICESTATEID$ --servicestatetype=$SERVICESTATETYPE$ --currentattempt=$SERVICEATTEMPT$ --maxattempts=$MAXSERVICEATTEMPTS$ --serviceeventid=$SERVICEEVENTID$ --serviceproblemid=$SERVICEPROBLEMID$ --serviceoutput="$SERVICEOUTPUT$" --longserviceoutput="$LONGSERVICEOUTPUT$" --datetime="$LONGDATETIME$"
}

###############################################################################
#
# Check command configuration file
#
# END OF FILE
#
###############################################################################
~
~
~
Last edited by mcapra on Tue Jun 14, 2016 2:00 pm, edited 1 time in total.
Reason: please wrap long/technical outputs in [code] tags
almanasra2005
Posts: 3
Joined: Fri May 27, 2016 2:11 pm

Re: Configurations failed to write to file.

Post by almanasra2005 »

I still have this error
Error: Command name of command line is NULL
Error: Could not register command (config file '/usr/local/nagios/etc/commands.cfg', starting on line 276)
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Configurations failed to write to file.

Post by Box293 »

Do this:

Go into CCM
Tools > Write Config Files
Click the Write Button
It will show an output of all the files it creates
Click the Verify button
The output should end with the error you are getting.

Now upload the file /usr/local/nagios/etc/commands.cfg

The snipped you uploaded before was the "good" file that it rolled back to. The steps I showed you above has the file in the error state and we'll be able to better see what is going on.

I suspect though that the error "Command name of command line is NULL" is the actual cause of your problem. Go to:

CCM
Commands > Commands
Do you have any commands that have an empty "Command Name" field?
If you do, you need to resolve this.

If you don't, perhaps you have a database error.
Run this command

Code: Select all

tail /var/log/mysqld.log -n 100 > /tmp/mysqld_log.txt
Send us this file:
/tmp/mysqld_log.txt
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked