# Ansible nagios module, command action with parameters

**URL:** <https://forum.ansible.com/t/ansible-nagios-module-command-action-with-parameters/28747>\
**Category:** Ansible Project\
**Created:** [October 9, 2018, 10:20am UTC](https://forum.ansible.com/t/ansible-nagios-module-command-action-with-parameters/28747 "2018-10-09T10:20:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Willem\_D\_Haese](https://avatars.discourse-cdn.com/v4/letter/w/b38774/32.png) [@Willem\_D\_Haese](https://forum.ansible.com/u/Willem_D_Haese)\
**Post date:** [October 9, 2018, 10:20am UTC](https://forum.ansible.com/t/ansible-nagios-module-command-action-with-parameters/28747/1 "2018-10-09T10:20:39Z")

</div>

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](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](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

---

<div class="post-metadata">

**Author:** ![Brad2](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Brad2](https://forum.ansible.com/u/Brad2)\
**Post date:** [October 9, 2018, 11:59am UTC](https://forum.ansible.com/t/ansible-nagios-module-command-action-with-parameters/28747/2 "2018-10-09T11:59:33Z")

</div>

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?
