You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Arun Patel <ar...@gmail.com> on 2015/09/14 22:27:37 UTC

Ambari Custom Alerts Question

Have couple of questions on Ambari custom alerts.

1) I developed a python script to check the znodes of zookeeper.  I used
the option "ignore_host": true and its working fine.  Now, in this case,
the script will run on which host?  any one of the 3 zookeeper hosts?

2) I would like to pass a custom parameter to the script from Ambari Alert
page.  The user should click edit to change the parameter as needed.  How
do I provide this option in alerts.json?

Regards,
Arun

Re: Ambari Custom Alerts Question

Posted by Jonathan Hurley <jh...@hortonworks.com>.
The interval at which the alert triggers is a global option for all alerts. That’s why the web client exposes it. Currently, the web client does not support the display or edit of any custom parameters of alert definitions.

> On Sep 18, 2015, at 7:00 AM, Arun Patel <ar...@gmail.com> wrote:
> 
> Yes, but these 3 custom parameters cannot be changed from ambari alert gui
> edit option.  Only parameter that can be edited is "Check Interval".  Can I
> pass any custom parameters like 'check interval' ?
> 
> Regards,
> Arun
> 
> On Wed, Sep 16, 2015 at 9:55 AM, Jonathan Hurley <jh...@hortonworks.com>
> wrote:
> 
>> Take a look at
>> https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/resources/alerts.json,
>> specifically the ambari_agent_disk_usage definition. It defines 3 custom
>> parameters.
>> 
>> On Sep 16, 2015, at 9:30 AM, Arun Patel <arunp.bigdata@gmail.com<mailto:
>> arunp.bigdata@gmail.com>> wrote:
>> 
>> Thanks Jon.
>> 
>> Can you please provide an example that creates the definition in
>> alerts.json with the parameter?
>> 
>> 
>> 
>> On Wed, Sep 16, 2015 at 9:00 AM, Jonathan Hurley <jhurley@hortonworks.com
>> <ma...@hortonworks.com>>
>> wrote:
>> 
>> Hi Arun,
>> 
>> The script is still distributed to run on all of the ZK hosts. However,
>> when the data is aggregated from the hosts, new alert instances will not be
>> created per-host. Instead, they will be used to update a single alert
>> instance.
>> 
>> The Ambari Web Client does not expose the ability to view or edit custom
>> parameters of alert definitions. For this, you’d need to either create the
>> definition in alerts.json with the parameter or use the alert definition
>> API endpoint to create/update the definition with the custom parameter
>> using a POST or PUT respectively.
>> 
>> On Sep 14, 2015, at 4:27 PM, Arun Patel <arunp.bigdata@gmail.com<mailto:
>> arunp.bigdata@gmail.com>> wrote:
>> 
>> Have couple of questions on Ambari custom alerts.
>> 
>> 1) I developed a python script to check the znodes of zookeeper.  I used
>> the option "ignore_host": true and its working fine.  Now, in this case,
>> the script will run on which host?  any one of the 3 zookeeper hosts?
>> 
>> 2) I would like to pass a custom parameter to the script from Ambari
>> Alert
>> page.  The user should click edit to change the parameter as needed.  How
>> do I provide this option in alerts.json?
>> 
>> Regards,
>> Arun
>> 
>> 
>> 
>> 


Re: Ambari Custom Alerts Question

Posted by Arun Patel <ar...@gmail.com>.
Yes, but these 3 custom parameters cannot be changed from ambari alert gui
edit option.  Only parameter that can be edited is "Check Interval".  Can I
pass any custom parameters like 'check interval' ?

Regards,
Arun

On Wed, Sep 16, 2015 at 9:55 AM, Jonathan Hurley <jh...@hortonworks.com>
wrote:

> Take a look at
> https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/resources/alerts.json,
> specifically the ambari_agent_disk_usage definition. It defines 3 custom
> parameters.
>
> On Sep 16, 2015, at 9:30 AM, Arun Patel <arunp.bigdata@gmail.com<mailto:
> arunp.bigdata@gmail.com>> wrote:
>
> Thanks Jon.
>
> Can you please provide an example that creates the definition in
> alerts.json with the parameter?
>
>
>
> On Wed, Sep 16, 2015 at 9:00 AM, Jonathan Hurley <jhurley@hortonworks.com
> <ma...@hortonworks.com>>
> wrote:
>
> Hi Arun,
>
> The script is still distributed to run on all of the ZK hosts. However,
> when the data is aggregated from the hosts, new alert instances will not be
> created per-host. Instead, they will be used to update a single alert
> instance.
>
> The Ambari Web Client does not expose the ability to view or edit custom
> parameters of alert definitions. For this, you’d need to either create the
> definition in alerts.json with the parameter or use the alert definition
> API endpoint to create/update the definition with the custom parameter
> using a POST or PUT respectively.
>
> On Sep 14, 2015, at 4:27 PM, Arun Patel <arunp.bigdata@gmail.com<mailto:
> arunp.bigdata@gmail.com>> wrote:
>
> Have couple of questions on Ambari custom alerts.
>
> 1) I developed a python script to check the znodes of zookeeper.  I used
> the option "ignore_host": true and its working fine.  Now, in this case,
> the script will run on which host?  any one of the 3 zookeeper hosts?
>
> 2) I would like to pass a custom parameter to the script from Ambari
> Alert
> page.  The user should click edit to change the parameter as needed.  How
> do I provide this option in alerts.json?
>
> Regards,
> Arun
>
>
>
>

Re: Ambari Custom Alerts Question

Posted by Jonathan Hurley <jh...@hortonworks.com>.
Take a look at https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/resources/alerts.json, specifically the ambari_agent_disk_usage definition. It defines 3 custom parameters.

On Sep 16, 2015, at 9:30 AM, Arun Patel <ar...@gmail.com>> wrote:

Thanks Jon.

Can you please provide an example that creates the definition in
alerts.json with the parameter?



On Wed, Sep 16, 2015 at 9:00 AM, Jonathan Hurley <jh...@hortonworks.com>>
wrote:

Hi Arun,

The script is still distributed to run on all of the ZK hosts. However,
when the data is aggregated from the hosts, new alert instances will not be
created per-host. Instead, they will be used to update a single alert
instance.

The Ambari Web Client does not expose the ability to view or edit custom
parameters of alert definitions. For this, you’d need to either create the
definition in alerts.json with the parameter or use the alert definition
API endpoint to create/update the definition with the custom parameter
using a POST or PUT respectively.

On Sep 14, 2015, at 4:27 PM, Arun Patel <ar...@gmail.com>> wrote:

Have couple of questions on Ambari custom alerts.

1) I developed a python script to check the znodes of zookeeper.  I used
the option "ignore_host": true and its working fine.  Now, in this case,
the script will run on which host?  any one of the 3 zookeeper hosts?

2) I would like to pass a custom parameter to the script from Ambari
Alert
page.  The user should click edit to change the parameter as needed.  How
do I provide this option in alerts.json?

Regards,
Arun




Re: Ambari Custom Alerts Question

Posted by Arun Patel <ar...@gmail.com>.
Thanks Jon.

Can you please provide an example that creates the definition in
alerts.json with the parameter?



On Wed, Sep 16, 2015 at 9:00 AM, Jonathan Hurley <jh...@hortonworks.com>
wrote:

> Hi Arun,
>
> The script is still distributed to run on all of the ZK hosts. However,
> when the data is aggregated from the hosts, new alert instances will not be
> created per-host. Instead, they will be used to update a single alert
> instance.
>
> The Ambari Web Client does not expose the ability to view or edit custom
> parameters of alert definitions. For this, you’d need to either create the
> definition in alerts.json with the parameter or use the alert definition
> API endpoint to create/update the definition with the custom parameter
> using a POST or PUT respectively.
>
> > On Sep 14, 2015, at 4:27 PM, Arun Patel <ar...@gmail.com> wrote:
> >
> > Have couple of questions on Ambari custom alerts.
> >
> > 1) I developed a python script to check the znodes of zookeeper.  I used
> > the option "ignore_host": true and its working fine.  Now, in this case,
> > the script will run on which host?  any one of the 3 zookeeper hosts?
> >
> > 2) I would like to pass a custom parameter to the script from Ambari
> Alert
> > page.  The user should click edit to change the parameter as needed.  How
> > do I provide this option in alerts.json?
> >
> > Regards,
> > Arun
>
>

Re: Ambari Custom Alerts Question

Posted by Jonathan Hurley <jh...@hortonworks.com>.
Hi Arun,

The script is still distributed to run on all of the ZK hosts. However, when the data is aggregated from the hosts, new alert instances will not be created per-host. Instead, they will be used to update a single alert instance. 

The Ambari Web Client does not expose the ability to view or edit custom parameters of alert definitions. For this, you’d need to either create the definition in alerts.json with the parameter or use the alert definition API endpoint to create/update the definition with the custom parameter using a POST or PUT respectively. 

> On Sep 14, 2015, at 4:27 PM, Arun Patel <ar...@gmail.com> wrote:
> 
> Have couple of questions on Ambari custom alerts.
> 
> 1) I developed a python script to check the znodes of zookeeper.  I used
> the option "ignore_host": true and its working fine.  Now, in this case,
> the script will run on which host?  any one of the 3 zookeeper hosts?
> 
> 2) I would like to pass a custom parameter to the script from Ambari Alert
> page.  The user should click edit to change the parameter as needed.  How
> do I provide this option in alerts.json?
> 
> Regards,
> Arun