Support Questions

Find answers, ask questions, and share your expertise

How to use "NOT" conditions in Cloudera triggers

avatar
New Contributor

Hi,

Could you let me know how to use "NOT" related conditions in Cloudera Manager triggers.

 

Ex: If mount point "/test" is NOT found on host, then it should alert.

3 REPLIES 3

avatar
Master Collaborator

@rmr1989 

 

You can edit the expression manually to include the NOT operator. Check the below example which uses NOT operator for a trigger.

A trigger expression takes the form:

IF (CONDITIONS) DO HEALTH_ACTION

 

A condition is any valid tsquery statement with below syntax. 

SELECT [metric expression]WHERE [predicate]

 

Mount point is an attribute which can be used in filter conditions but not metric expression. Hence, I believe it would not be possible to create a trigger on mount point scans.

 

Refer below document which lists the supported metrics:

https://docs.cloudera.com/documentation/enterprise/latest/topics/cm_metrics.html#xd_583c10bfdbd326ba...

 

Example:

 

IF (SELECT total_xceivers_across_datanodes WHERE serviceName=$SERVICENAME AND last(total_xceivers_across_datanodes) != 0 AND entityName = "HDFS-1:ns1" AND category = "SERVICE") DO health:concerning

 

Hope this helps,
Paras
Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.

avatar
New Contributor

Hi Paras,

 

Thanks for the reply.

In that case, is there any other way to get an alert from Cloudera manager if a mount is missing in an host. ?

avatar
Master Collaborator

@rmr1989 

 

Ideally, for a missing mounts in the cluster you would automatically get alerts for services if any hadoop service directories cannot be accessed which are mapped to the mountpoint. They can be generic though like "no such file or directory" or "file not found" errors.

 

If you are looking for specific mountpoint availability, you should consider using script to scan for mountpoints in the cluster hosts and can send email alerts using SMTP from the host instead of Cloudera Manager.

 

Hope this helps,
Paras
Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.