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.
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.
-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
|