Ansible nagios module, command action with parameters

Hello,

I need to schedule a forced service check for all services on a Nagios host. This is possible with the ‘SCHEDULE_FORCED_HOST_SVC_CHECKS’ command.

https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/cmdinfo.php?command_id=130

The Ansible nagios module seems to have a ‘command’ action, but I can’t find any example how to use this with parameters.

https://docs.ansible.com/ansible/2.6/modules/nagios_module.html

As I need to add hostname and checktime to use ‘SCHEDULE_FORCED_HOST_SVC_CHECKS’, could someone please enlighten me if it is supported to use the command action with parameters?

Grtz

Willem

Have you tried:

`

  • name: force-nagios-check
    nagios:
    action: command
    command: SCHEDULE_FORCED_HOST_SVC_CHECKS;{{inventory_hostname}};{{ansible_date_time.epoch}}

`

see if that works? This module might not have that option. Another option is to just use the command module?