Hi, I'm trying to modify a service changing the argument DISKNAME using the REST API. But it doesn't work.
This is the steps I'm following:
- Creating the service:
curl --silent --location 'http://pepe.com/centreon/api/index.php?action=action&object=centreon_clapi' --header 'Content-Type: application/json' --header 'centreon-auth-token: <token>' --data '{ "action": "add", "object": "service", "values": "windows_vm;Filesystem D;OS-Windows-Disk-Generic-Name-SNMP" }'
{"result":[]}
- Adding the check command to the service:
curl --silent --location 'http://pepe.com/centreon/api/index.php?action=action&object=centreon_clapi' --header 'Content-Type: application/json' --header 'centreon-auth-token: <token>' --data '{ "action": "setparam", "object": "service", "values": "windows_vm;Filesystem D;check_command;OS-Windows-SNMP-Disk-Name" }'
{"result":[]}
- Adding the partition Letter (this is where i'm failing):
curl --silent --location 'http://pepe.com/centreon/api/index.php?action=action&object=centreon_clapi' --header 'Content-Type: application/json' --header 'centreon-auth-token: <token>' --data '{ "action": "setparam", "object": "service", "values": "windows_vm;Filesystem D;check_command_arguments;!D:!^(..).*!$1!80!90!--filter-perfdata='\''storage.space|used|free'\'' --regexp" }'
{"result":[]}
But when I look at the service nothing changes. Where I'm failling? (I reload and export the configuration in every change I made)
PD: Excuse my English, I'm still working on improving it. If there is any problem with my explanation or if you need more clarity, please let me know. Thanks you!
Best answer by vcoum
View original