[racktables-users] Re: API related questions

  • From: Denis Ovsienko <pilot@xxxxxxxxxx>
  • To: racktables-users@xxxxxxxxxxxxx
  • Date: Tue, 1 Sep 2009 19:28:49 +0400

Hello, all.

> we want to allow a system monitoring solution (nagios) to set a object an
> has problems by just calling a webaddress with the name of the server.
> Something like http://racktables.org/api.php?name=server01&problem=yes
> To archiv it would be better to have one function that only changes this
> value, and not all.

I would suggest to avoid the "has problems" flag. There is only one
thing, which prevents dropping it completely: this flag affects the
color of an object. This will be sorted out eventually.

For your specific application I would suggest using a tag to indicate
problems right today. This should save you some time after the flag is
finally gone. Let's suppose you have created a tag named "faulty".
Mousing over it in the tag tree gives you its ID. Let it be 100.

Listing all objects tagged "faulty" is simple by means of both
web-interface and API.

Removing this tag from an object is simple:
deleteTagForEntity ('object', $objectid, 100);

Adding the tag is a bit more tricky:
rebuildTagChainForEntity ('object', $objectid, array (100));

These two functions are not yet final, but I expect them to remain as
they are till the end of this year. Once you wrap them with a PHP file,
this shouldn't be a big issue.

-- 
    Denis Ovsienko

Other related posts: