Icinga2 WebUI - Runs a Script without Arguments?

Hi all,

first time posting here.
I am new with Icinga and just starting to understand the workings of it.

I am using Icinga2 - and have two environments.
One used for Staging, the second for Production.
Each environment also has its own satellite.

Both satellites are monitoring various World-Wide Gateways using SNMP, and have scripts to parse the various SNMP results to a human-friendly syntax.
Both use the same scripts as well, so it’s easy to manage.

Just for General information - All scripts are constructed in the following way:
./SCRIPT (space) ARGUMENT (Hostname/IP)

So basically - each script does something to said host over SNMP, then parses the result to human-readable output.

Now, the issue:
############
For just one of said scripts, it runs just fine on the Staging, but that same script on Production - appears as though it’s being run without an argument.

## Plugin Output
Usage: /home/icinga/snmp/asset_info.sh

The strange thing is that when I run that same script, from the satellite itself (e.g – # ./asset_info HOST_IP) - it does run perfectly and provides the necessary output as it should.

All other scripts are built to run in the same way (activate script + Monitored-Host IP) - and are working.
I checked and the production instance, has the same groups, objects and flow as the Staging.

Here is what it looks like on the staging instance
image

Here is how it looks like in the Production instance
image
###################################################

I can also attach the script, if anyone thinks it could be relevant?
Although as I mentioned, that same script does work in the staging instance.

If there is any additional helpful information I can share, please let me know!

Hi,

we’ll need the CheckCommand object and Host/Service objects or apply rules which execute the command then. I bet there is a custom variable missing somewhere in production.

Cheers,
Michael

As which user do you run the script at the satellite? When it’s executed by the satellite then it runs as nagios or icinga (depending on the distribution you’re using) and for tests you should do the same. Otherwise you might have a different environment. Example for a test run:

sudo -u nagios /your/script ARGUMENT (Hostname/IP)

Hi Michael,

Thanks for the response.

I think this is actually the correct direction, as I recall us setting up a custom variable at some point during the STG deployment (not sure what or where exactly it was), but for sure we didn’t create one in PRD.

Is there an easy way to find where or what it was?

Turns out I had a missing argument for that particular script command - in the ‘Arguments’ field.
$address$

Once I added this the script ran fine.