From some manual or redbook, don't remember which one, we got the below code.
Works perfectly. Have used it for at least 10 years now.
You will need to code your own script /usr/local/bin/vit_check_smsg.sh to
decode whatever text-command you sent and take proper action 😊
BR /Tore
#
# Sample udev rules for processing CP special messages.
# Rules for unique incoming iucv messages
# This file should be installed in /etc/udev/rules.d
#
# syntax from z/VM: smsg zlin1002 APP user some_command_text extra_parms
#
#
DEVPATH!="*/smsgiucv_app", GOTO="smsgiucv_app_end"
# ---------- Rules for CP messages go here -------ÂÂ
# --- Initialization --ÂÂ
# load vmcp
SUBSYSTEM=="module", ACTION=="add", RUN+="/sbin/modprobe --quiet vmcp"
# load vmur and set the virtual punch device online
SUBSYSTEM=="module", ACTION=="add", RUN+="/sbin/modprobe --quiet vmur"
SUBSYSTEM=="module", ACTION=="add", RUN+="/sbin/chccwdev -e d"
# --- Special rules available for particular z/VM user IDs --ÂÂ
ENV{SMSG_SENDER}!="MAINT|OPERATOR|ZLINADM", GOTO="smsgiucv_app_continue"
# DMESG: punch dmesg output to sender
ACTION=="change", ENV{SMSG_TEXT}=="DMESG", \
ENV{PATH}="/bin:/sbin:/usr/bin:/usr/sbin", \
RUN+="/bin/bash -c 'dmesg |fold -s -w 74 |vmur punch -r -t -N LINUX.DMESG -u $
GOTO="smsgiucv_app_end"
LABEL="smsgiucv_app_continue"
# --- Rules for all senders ---ÂÂ
# Any cmd, will be checked by /usr/local/bin/vit_check_smsg.sh
ACTION=="change", \
ENV{PATH}="/bin:/sbin:/usr/bin:/usr/sbin", \
PROGRAM=="/usr/local/bin/vit_check_smsg.sh $env{SMSG_SENDER} $env{SMSG_TEXT}",
RUN+="/sbin/vmcp msg $env{SMSG_SENDER} âd has arrived, will check it nowâ
LABEL="smsgiucv_app_end"
Tore Agblad
Group Technical Specialist
Senior Infrastructure Architect and System Programmer – Mainframe zOpen
HCL Technologies Ltd.
Gunnar Engellaus väg 3, 418 78 Gothenburg, Sweden
www.hcltech.com
www.hcl.com
::DISCLAIMER:: The contents of this e-mail and any attachment(s) are
confidential and intended for the named recipient(s) only. E-mail transmission
is not guaranteed to be secure or error-free as information could be
intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may
contain viruses in transmission. The e mail and its contents (with or without
referred errors) shall therefore not attach any liability on the originator or
HCL or its affiliates. Views or opinions, if any, presented in this email are
solely those of the author and may not necessarily reflect the views or
opinions of HCL or its affiliates. Any form of reproduction, dissemination,
copying, disclosure, modification, distribution and / or publication of this
message without the prior written consent of authorized representative of HCL
is strictly prohibited. If you have received this email in error please delete
it and notify the sender immediately. Before opening any email and/or
attachments, please check them for viruses and other defects..
-----Original Message-----
From: Linux on 390 Port <[email protected]> On Behalf Of Dave Jones
Sent: Wednesday, August 19, 2020 9:38 PM
To: [email protected]
Subject: Re: smsgiucv_app
[CAUTION: This Email is from outside the Organization. Unless you trust the
sender, Don’t click links or open attachments as it may be a Phishing email,
which can steal your Information and compromise your Computer.]
Hi, Mark.
Yes, I have Richard's presentation here but I couldn't quite follow how to code
the udev rules to accomplish what I wanted to. Jame's example was the key....
Stay safe.
DJ
---
DAVID JONES | MANAGING DIRECTOR FOR ZSYSTEMS SERVICES | z/VM, Linux, and Cloud
703.237.7370 (Office) | 281.578.7544 (CELL)
INFORMATION TECHNOLOGY COMPANY
On 08.19.2020 12:05 PM, Mark Post wrote:
> On 8/19/20 8:19 AM, Dave Jones wrote:
>>
>> Before I go down this rabbit hole, does anyone here have a working
>> example of the smsgiucv_app that I could look at? I don't seem to
>> understand how to code the udev rules correctly.
>
> Richard Lewis gave a session on this several times at SHARE entitled
> "If I Send a Special Message to Linux on System z Will it Answer?
> Automating
> Linux on z/VM"
>
> It should be in the proceedings from SHARE 119, 120, 121, and 122. If
> not, I can send you a copy.
>
>
> Mark Post
>
> ----------------------------------------------------------------------
> For LINUX-390 subscribe / signoff / archive access instructions, send
> email to [email protected] with the message: INFO LINUX-390 or
> visit
> https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww2.
> marist.edu%2Fhtbin%2Fwlvindex%3FLINUX-390&data=02%7C01%7Ctore.agbl
> ad%40HCL.COM%7C93b2bf838acb4aee9a4e08d84477a01a%7C189de737c93a4f5a8b68
> 6f4ca9941912%7C0%7C0%7C637334627881359629&sdata=%2FJtTQeH7nUOq99hZ
> VAiQWIhywVa48myKPI6tRSusTyE%3D&reserved=0
----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions, send email to
[email protected] with the message: INFO LINUX-390 or visit
https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww2.marist.edu%2Fhtbin%2Fwlvindex%3FLINUX-390&data=02%7C01%7Ctore.agblad%40HCL.COM%7C93b2bf838acb4aee9a4e08d84477a01a%7C189de737c93a4f5a8b686f4ca9941912%7C0%7C0%7C637334627881369623&sdata=QLUPnxTUtP5mVvJYdGunOhgxRg3p7RohOZ4087TUjWk%3D&reserved=0
----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www2.marist.edu/htbin/wlvindex?LINUX-390