How do I create an alert after configuring a hook?

Hi all,

I want to use hooks ( Hooks Docs ) to create alerts based on the different machine states of my VM’s.

I created a hook that successfully reports machines going to the ‘SHUTDOWN’ state:

EXECUTION LOG
   ID       TIMESTAMP    RC EXECUTION
    0     06/02 12:59   255 ERROR

How do I create alerts from this point? For example, I want a message to appear on the Sunstone interface showing my hook, or I want an email to be send out after a hook is activated. Is this possible? Thanks in advance!

1 Like

Hi @anoesheartje,

First, note that you have an error in the hook execution. You can see information about an execution with onehook show <HOOK_ID> -e <EXEC_ID>.

How do I create alerts from this point? For example, I want a message to appear on the Sunstone interface showing my hook, or I want an email to be send out after a hook is activated. Is this possible?

You can do almost everything by programming a script like this. Maybe sending an email is more straightforward than displaying a message in Sunstone, but it could be possible as well.

Cheers

Hello @rdiaz
Adding to the Hook concept.
I want to update the value of User-input as soon as VM is instantiated.
How can I achieve this using CLI and XML-RPC API. Any onevm update commands are there for updating user-inputs of Running VM?

Hi @Rahul_Sharma,

Check the onevm updateconf command.

Cheers.