Eric,
For some reason, that does not work as expected - it returns no rows, even
though there are several which are not null.

mysql> select device, component from status where eventState = 0;
+-----------+------------+
| device    | component  |
+-----------+------------+
| HT28107D1 | NULL       | 
| zenoss    | zenagios   | 
| HT28107D1 | http       | 
| linux     | zenactions | 
+-----------+------------+
4 rows in set (0.00 sec)

mysql> select device, component from status where eventState = 0 and
component <> NULL;
Empty set (0.00 sec)

I also tried these variations:

mysql> select device, component from status where eventState = 0 and
component = NULL;
Empty set (0.00 sec)

mysql> select device, component from status where eventState = 0 and
component is NULL;
Empty set (0.00 sec)

mysql> select device, component from status where eventState = 0 and
component is not NULL;
+-----------+------------+
| device    | component  |
+-----------+------------+
| HT28107D1 | NULL       | 
| HT28107D1 | http       | 
| linux     | zenactions | 
+-----------+------------+
3 rows in set (0.00 sec)



>Hi SLander,
>
>Simple change: '<> NULL' instead of '<> "NULL"'
>
>-Eric

[EMAIL PROTECTED] wrote:
> Eric,
>
>     Thanks for the quick reply.   This will work for me, I think.   It
> looks like:
>
> 1.   If an event clears, it is removed from the status table
> 2.   If it not yet acknowledged, the eventState is 0
> 3.   If it has been acknowledged, the eventState is set to 1
>
> So, the following gets me all current unacknowledged events:
> select device, component from status where eventState = 0 and device <>
> 'linux' and device <> 'zenoss';
>
> (the linux and zenoss parts get rid of localhost (linux) and zenoss
> (program) errors)
>
> +------------+-----------+
> | device     | component |
> +------------+-----------+
> | HT28107D1  | NULL      |
>
> This returns in my case a half dozen items - as it turns out, they are
all
> component "NULL".   Tracking this down, they are WMI permission denied
> events.    No problem, but I would like to filter them out.
>
> (Note: WMI should probably not set component to NULL?)
>
> So, I tried:
> mysql> select device, component from status where eventState = 0 and
> device <> 'linux' and device <> 'zenoss' and component <> 'NULL';
> +------------+-----------+
> | device     | component |
> +------------+-----------+
> | HT28107D1  | NULL      |
>
> No luck, and I have used up my sql skills.... Any suggestions?
>
>
>
>
> You could use an external query to the MySQL database to determine if 
> there are any events matching your criteria for failure.  You want to 
> use the status table in the "events" database.
>
> -Eric
>
> [EMAIL PROTECTED] wrote:
>   
>> How (or can I?) do I set up Zenoss to execute a script on a failure
>> detection?
>>
>> IE  - I want my Zenoss server to turn on a light for critical failures.
>> It helps my help desk to be aware of the issue late at night.   The
>>     
> light
>   
>> is controlled by a serial port module (X10).
>>
>> How would I get zenoss to run the external command?
>>
>> Or - alternatively - I already have a syslog filter that will do this -
>> how would I get Zenoss to write device or event information to syslog?
>>
>>   
>>     
> This e-mail message is intended only for the personal use of the
recipient(s) named above. If you are not an intended recipient, you may
not review, copy or distribute this message. If you have received this
communication in error, please notify the Hearst Service Center
([EMAIL PROTECTED]) immediately by email and delete the original
message.
> _______________________________________________
> zenoss-users mailing list
> [email protected]
> http://lists.zenoss.org/mailman/listinfo/zenoss-users
>
>   

_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users
This e-mail message is intended only for the personal use of the recipient(s) 
named above. If you are not an intended recipient, you may not review, copy or 
distribute this message. If you have received this communication in error, 
please notify the Hearst Service Center ([EMAIL PROTECTED]) immediately by 
email and delete the original message.
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users

Reply via email to