I am little new on nagios and I would like to create a new command. I already have to try but no result. I have defines the command in the file commands.cfg but every time I have an error message in nagios interface web which tells me “unknown command”.
For example I wanted to create a new command “checkfilesize” here is how I have to proceed
I have defines this command
define command {
command_name CheckFileSize
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckFileSize -a ShowAll MaxCrit=$ARG1$ File:$ARG2$=$ARG3$

Then I have defines the service in the file conf of the machine concerned
define service{
use generic-service
host_name $HOSTNAME
service_description CheckFolder
check_command check_nrpe!CheckFileSize -H $HOSTADRRESS -p 5666 -c CheckFileSize -a ShowAll MaxCrit=!1G!Win!=C:\\CheckFolder
Restart nagios service and type the following command on nagios server
check_nrpe!CheckFileSize -H $HOSTADRESS -p 5666 -c CheckFileSize -a ShowAll MaxCrit=1G File:Win=D:\\Folder\\To\\Check
I got this error “-bash: !CheckFileSize: event not found”

I am a little lost here, if somebody can help me that would be cool thank you in advance.
Here is my config I have an nsclient++ 0.5.62 configured on my remote machine (windows 7), and an nagios 4.1 installed on centos 6.8 and this topic show exactly what I want to do https: // forums.monitoring-fr.org / index.php? Topic=227.0