Support Forum

External Command: Malformed Command

External Command: Malformed Command

Posted: Mon Dec 10, 2018 4:04 am

by shekharalle

Hi I have a RHEL(Red Hat Enterprise Linux) instance in which I have Nagios Core-4.4.1 and NSCA installed and I have Riemann installed and configured which is sending events to NSCA.But in the logs I see that when Riemann is sending events it is showing me External Command: Command Malformed and also External command failed and it shows an entry of that event in the log.And do I need to define a service to process the passive check.Any help would be really appreciated.

Re: External Command: Malformed Command

External command error: Command failedError: External command failed -> PROCESS_SERVICE_CHECK_RESULT;jumphost;cpu;0;11.75% user+nice+systemWarning: Passive check result was received for service 'cpu' on host 'jumphost, but the service could not be found!EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;jumphost;cpu;0;11.75% user+nice+system

Re: External Command: Malformed Command

Posted: Tue Dec 11, 2018 12:06 pm

by mcapra

The Nagios Core daemon tried to find a service with description "cpu" under host "jumphost" and was unable to do so.

For this command to correctly resolve, you would need a service definition that looks something like this:

Re: External Command: Malformed Command

[cloud-user@jumphost ~]$ cat /usr/local/nagios/etc/objects/localhost.cfg ################################################################################ LOCALHOST.CFG - SAMPLE OBJECT CONFIG FILE FOR MONITORING THIS MACHINE### NOTE: This config file is intended to serve as an *extremely* simple# example of how you can create configuration entries to monitor# the local (Linux) machine.################################################################################

use linux-server ; Name of host template to use ; This host definition will inherit all variables that are defined ; in (or inherited by) the linux-server host template definition. host_name localhost alias localhost address 127.0.0.1}

Re: External Command: Malformed Command

I'm not familiar with Riemann or configuring it, but if it is sending the command:

PROCESS_SERVICE_CHECK_RESULT;jumphost;cpu;0;11.75% user+nice+system

then a host and sevice will need to be configured as @mcapra pointed out OR Riemann would need to be configured to send data like:

PROCESS_SERVICE_CHECK_RESULT;localhost;cpu;0;11.75% user+nice+system

Re: External Command: Malformed Command

Posted: Tue Dec 11, 2018 9:05 pm

by shekharalle

It is giving output with FQDN and I'm doing this on the same machine so host and service definitions are already configured/defined.So do I need to create another host definition jumphost.cfg and service definition for this FQDN?Also do I need to add a command in commands.cfg for it as it is not an active check?