1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 <2021> 2022 2023 2024 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 <2021> 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Configuring Phoebus alarm related display via a kafka message |
From: | "Kasemir, Kay via Tech-talk" <tech-talk at aps.anl.gov> |
To: | John Dobbins <john.dobbins at cornell.edu>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Cc: | Keara Louise Soloway <kls286 at cornell.edu> |
Date: | Fri, 20 Aug 2021 12:42:20 +0000 |
At first glance it looks like the script might not send the JSON correctly:
"config:/CHESS/Other/jad_test" : {"user":"jad22","host":"lnx615.classe.cornell.edu","description":"jad_test"}
I think that's missing some single quotes around the whole line to assert that the double-quotes within the JSON are passed.
But to check what's missing, best run the monitor_topic.sh from https://github.com/ControlSystemStudio/phoebus/tree/master/app/alarm/examples :
monitor_topic.sh CHESS
in some terminal and then add a PV
a) from the alarm GUI
b) from the command line
In the monitor output, see what's different.
-Kay
From: John Dobbins <john.dobbins at cornell.edu>
Sent: Friday, August 20, 2021 8:29 AM To: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>; Kasemir, Kay <kasemirk at ornl.gov> Cc: Phillip A. Sorensen <pas37 at cornell.edu>; Keara Louise Soloway <kls286 at cornell.edu> Subject: [EXTERNAL] Re: Configuring Phoebus alarm related display via a kafka message
I am trying to add a PV via kafka-console-producer.sh
The following does not generate an error but the PV, jad_test, does not show up in the Alarm GUI . Any idea where I am going astray?
jad22@chess15 $ /mnt/services/kafka/kafka/bin/kafka-console-producer.sh \
> --bootstrap-server chess-kafka:9092 \
> --topic CHESS \
> --property parse.key=true \
> --property key.separator=":"
"config:/CHESS/Other/jad_test" : {"user":"jad22","host":"lnx615.classe.cornell.edu","description":"jad_test"}
[Note the message was copied from that captured by kafka-console-produce.sh when I made the same addition via the GUI]
Do I have a syntax error in the message format? Something else?
Thanks,
John Dobbins
From: Kasemir, Kay <kasemirk at ornl.gov>
Sent: Thursday, August 19, 2021 7:55 PM To: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>; John Dobbins <john.dobbins at cornell.edu> Subject: Re: Configuring Phoebus alarm related display via a kafka message
Hi:
Yes, you can use a script that sends the info.
Could use python, or call the kafka/bin/kafka-console-producer.sh command
line tool that comes with Kafka.
But note that the message can not just contain user, host, displays.
You may actually omit the user & host, that's just for logging tools that might want to show
who changed something. The alarm server and clients don't care about the user/host. But you must always include the complete configuration, i.e., description,
delay, count, filter, guidance, displays, commands, actions. If you just send displays, that would be the same as deleting guidance, commands, actions, description,
and clearing filter etc.
See https://github.com/ControlSystemStudio/phoebus/blob/master/app/alarm/Readme.md#message-formats for the complete format.
-Kay
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of John Dobbins via Tech-talk <tech-talk at aps.anl.gov>
Sent: Thursday, August 19, 2021 4:31 PM To: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov> Subject: [EXTERNAL] Configuring Phoebus alarm related display via a kafka message
All,
I am looking to write a script which will set the related display info for a number of already configured alarms in Phoebus.
Can I send a kafka config message with JSON specifying just the user, host and display?
{
"user": String,
"host": String,
"displays": [{"title": String, "details": String}],
}
or will that unset the fields I have not specified?
Regards,
John Dobbins
Research Support Specialist
Cornell High Energy Synchrotron Source
Cornell University
|