Open antaflos opened 12 years ago
I don't think this should be too hard, so I'll take a look and see if I can come up with something. One workaround you might be able to use in the meantime, would be to write a script that uses the opsview_rest tool to retrieve a server's ID and then delete it, something like this:
#!/bin/sh
monitored=$1
id=`opsview_rest --user=admin --password=initial --pretty --data-format=json GET "config/host?s.name=$monitored&cols=id" | grep id | awk -F\" '{print $4}'`
opsview_rest --user=admin --password=initial DELETE "config/host/$id"
You could then use the script via an exec
in puppet.
Hi,
I know this is a known issue, i.e. the
opsview_*
types don't supportensure => 'absent'
. But we are, once again, trying to get Puppet and Opsview to play nice together, and have been bitten by this the other day, so I thought I'd report this issue here. We are trying to dynamically add and remove monitored devices and thus kind of need on a workingensure => 'absent'
for at least theopsview_monitored
type.Unfortunately we can't really contribute code as we are are not a Ruby shop in any way.