<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Georgia;
        panose-1:2 4 5 2 5 4 5 2 3 3;}
@font-face
        {font-family:"Garamond Premr Pro Smbd";
        panose-1:2 2 6 2 6 5 6 2 4 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma",sans-serif;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma",sans-serif;}
span.EmailStyle24
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle25
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle26
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle27
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle30
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>Thanks, Mike.  I should have mentioned more explicitly that I tried that, but the variable doesn’t seem to be passed through upssched to the shell script.  (Again – I may be missing something simple.)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>GMH<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From:</b> O'Shaughnessy, Mike [mailto:Mike.OShaughnessy@gd-ms.com] <br><b>Sent:</b> Tuesday, October 31, 2017 1:24 PM<br><b>To:</b> Garrett Michael Hayes <Garrett@VerbalImaging.com>; nut-upsuser@lists.alioth.debian.org<br><b>Subject:</b> RE: Email Alerts for Multiple UPSs with upssched<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='color:#1F497D'>There’s supposedly another way with a custom upsmon.conf:<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='margin-top:6.0pt'><strong><span style='font-size:13.5pt;font-family:"Georgia",serif;color:#083194'>NOTIFYMSG</span></strong><span style='font-size:13.5pt;font-family:"Georgia",serif;color:navy'> <em><span style='font-family:"Georgia",serif'>type</span></em> <em><span style='font-family:"Georgia",serif'>message</span></em><o:p></o:p></span></p><p style='mso-margin-top-alt:1.2pt;margin-right:0in;margin-bottom:6.0pt;margin-left:.5in'><span style='font-size:13.5pt;font-family:"Georgia",serif;color:black'>upsmon comes with a set of stock messages for various events. You can change them if you like.<o:p></o:p></span></p><pre style='margin-left:.5in;font-size:inherit;white-space:pre-wrap'><code><span style='color:navy'>NOTIFYMSG ONLINE "UPS %s is getting line power"</span></code><span style='color:navy'><o:p></o:p></span></pre><pre style='margin-left:.5in;font-size:inherit;white-space:pre-wrap'><code><span style='color:navy'>NOTIFYMSG ONBATT "Someone pulled the plug on %s"</span></code><span style='color:navy'><o:p></o:p></span></pre><p style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt'><span style='font-size:13.5pt;font-family:"Georgia",serif;color:black'>Note that </span><code><span style='font-size:10.0pt;color:navy'>%s</span></code><span style='font-size:13.5pt;font-family:"Georgia",serif;color:black'> is replaced with the identifier of the UPS in question.<o:p></o:p></span></p><p style='mso-margin-top-alt:6.0pt;margin-right:0in;margin-bottom:6.0pt;margin-left:.5in'><span style='font-size:13.5pt;font-family:"Georgia",serif;color:black'>The message must be one element in the configuration file, so if it contains spaces, you must wrap it in quotes.<o:p></o:p></span></p><pre style='margin-left:.5in;font-size:inherit;white-space:pre-wrap'><code><span style='color:navy'>NOTIFYMSG NOCOMM "Someone stole UPS %s"</span></code><span style='color:navy'><o:p></o:p></span></pre><p style='mso-margin-top-alt:6.0pt;margin-right:0in;margin-bottom:6.0pt;margin-left:.5in'><span style='font-size:13.5pt;font-family:"Georgia",serif;color:black'>Possible values for </span><em><span style='font-size:13.5pt;font-family:"Georgia",serif;color:navy'>type</span></em><span style='font-size:13.5pt;font-family:"Georgia",serif;color:black'>:<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:6.0pt;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt'><span style='font-size:13.5pt;font-family:"Georgia",serif;color:navy'>ONLINE<o:p></o:p></span></p><p style='mso-margin-top-alt:1.2pt;margin-right:0in;margin-bottom:6.0pt;margin-left:.5in'><span style='font-size:13.5pt;font-family:"Georgia",serif;color:black'>UPS is back online<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:6.0pt;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt'><span style='font-size:13.5pt;font-family:"Georgia",serif;color:navy'>ONBATT<o:p></o:p></span></p><p style='mso-margin-top-alt:1.2pt;margin-right:0in;margin-bottom:6.0pt;margin-left:.5in'><span style='font-size:13.5pt;font-family:"Georgia",serif;color:black'>UPS is on battery<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:6.0pt;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt'><span style='font-size:13.5pt;font-family:"Georgia",serif;color:navy'>LOWBATT<o:p></o:p></span></p><p style='mso-margin-top-alt:1.2pt;margin-right:0in;margin-bottom:6.0pt;margin-left:.5in'><span style='font-size:13.5pt;font-family:"Georgia",serif;color:black'>UPS is on battery and has a low battery (is critical)<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:6.0pt;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt'><span style='font-size:13.5pt;font-family:"Georgia",serif;color:navy'>FSD<o:p></o:p></span></p><p style='mso-margin-top-alt:1.2pt;margin-right:0in;margin-bottom:6.0pt;margin-left:.5in'><span style='font-size:13.5pt;font-family:"Georgia",serif;color:black'>UPS is being shutdown by the master (FSD = "Forced Shutdown")<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:6.0pt;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt'><span style='font-size:13.5pt;font-family:"Georgia",serif;color:navy'>COMMOK<o:p></o:p></span></p><p style='mso-margin-top-alt:1.2pt;margin-right:0in;margin-bottom:6.0pt;margin-left:.5in'><span style='font-size:13.5pt;font-family:"Georgia",serif;color:black'>Communications established with the UPS<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:6.0pt;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt'><span style='font-size:13.5pt;font-family:"Georgia",serif;color:navy'>COMMBAD<o:p></o:p></span></p><p style='mso-margin-top-alt:1.2pt;margin-right:0in;margin-bottom:6.0pt;margin-left:.5in'><span style='font-size:13.5pt;font-family:"Georgia",serif;color:black'>Communications lost to the UPS<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:6.0pt;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt'><span style='font-size:13.5pt;font-family:"Georgia",serif;color:navy'>SHUTDOWN<o:p></o:p></span></p><p style='mso-margin-top-alt:1.2pt;margin-right:0in;margin-bottom:6.0pt;margin-left:.5in'><span style='font-size:13.5pt;font-family:"Georgia",serif;color:black'>The system is being shutdown<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:6.0pt;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt'><span style='font-size:13.5pt;font-family:"Georgia",serif;color:navy'>REPLBATT<o:p></o:p></span></p><p style='mso-margin-top-alt:1.2pt;margin-right:0in;margin-bottom:6.0pt;margin-left:.5in'><span style='font-size:13.5pt;font-family:"Georgia",serif;color:black'>The UPS battery is bad and needs to be replaced<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:6.0pt;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt'><span style='font-size:13.5pt;font-family:"Georgia",serif;color:navy'>NOCOMM<o:p></o:p></span></p><p style='mso-margin-top-alt:1.2pt;margin-right:0in;margin-bottom:6.0pt;margin-left:.5in'><span style='font-size:13.5pt;font-family:"Georgia",serif;color:black'>A UPS is unavailable (can’t be contacted for monitoring)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma",sans-serif'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma",sans-serif'> Garrett Michael Hayes [<a href="mailto:Garrett@VerbalImaging.com">mailto:Garrett@VerbalImaging.com</a>] <br><b>Sent:</b> Tuesday, October 31, 2017 1:19 PM<br><b>To:</b> O'Shaughnessy, Mike; <a href="mailto:nut-upsuser@lists.alioth.debian.org">nut-upsuser@lists.alioth.debian.org</a><br><b>Subject:</b> RE: Email Alerts for Multiple UPSs with upssched<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='color:#1F497D'>Ah!  So I can detect the source UPS in the upssched.conf and pass it as a distinct event to the shell script.  That sounds like an excellent approach.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Thanks!<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>GMH<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From:</b> O'Shaughnessy, Mike [<a href="mailto:Mike.OShaughnessy@gd-ms.com">mailto:Mike.OShaughnessy@gd-ms.com</a>] <br><b>Sent:</b> Tuesday, October 31, 2017 12:46 PM<br><b>To:</b> Garrett Michael Hayes <<a href="mailto:Garrett@VerbalImaging.com">Garrett@VerbalImaging.com</a>>; <a href="mailto:nut-upsuser@lists.alioth.debian.org">nut-upsuser@lists.alioth.debian.org</a><br><b>Subject:</b> RE: Email Alerts for Multiple UPSs with upssched<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='color:#1F497D'>I’m running a single “nut-server” that monitors seven ups units.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>In upsmon.conf:<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>MONITOR ups-1   0 <User> <Pw> master<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>MONITOR ups-2   0 <User> <Pw> master<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>MONITOR ups-3   0 <User> <Pw> master<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>MONITOR ups-4   0 <User> <Pw> master<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>MONITOR ups-5   1 <User> <Pw> master<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>MONITOR ups-6   1 <User> <Pw> master<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>MONITOR ups-7   0 <User> <Pw> master<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>NOTIFYCMD /sbin/upssched<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>NOTIFYFLAG ONLINE       SYSLOG+WALL+EXEC<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>NOTIFYFLAG ONBATT       SYSLOG+WALL+EXEC<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>NOTIFYFLAG LOWBATT      SYSLOG+WALL+EXEC<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>NOTIFYFLAG FSD          SYSLOG+WALL+EXEC<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>NOTIFYFLAG COMMOK       SYSLOG+WALL+EXEC<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>NOTIFYFLAG COMMBAD      SYSLOG+WALL+EXEC<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>NOTIFYFLAG SHUTDOWN     SYSLOG+WALL+EXEC<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>NOTIFYFLAG REPLBATT     SYSLOG+WALL+EXEC<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>NOTIFYFLAG NOCOMM       SYSLOG+WALL+EXEC<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>NOTIFYFLAG NOPARENT     SYSLOG+WALL+EXEC<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>In upssched.conf<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>CMDSCRIPT /bin/upssched-cmd<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>AT LOWBATT ups-1        EXECUTE ups-1-low<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>AT LOWBATT ups-2        EXECUTE ups-2-low<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>AT LOWBATT ups-3        EXECUTE ups-3-low<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>AT LOWBATT ups-4        EXECUTE ups-4-low<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>AT LOWBATT ups-5        EXECUTE ups-5-low<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>AT LOWBATT ups-6        EXECUTE ups-6-low<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>AT LOWBATT ups-7        EXECUTE ups-7-low<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Upssched-cmd:<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>echo "upssched-cmd entry was $1"<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>case $1 in<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>        ups-1-low)<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>                /ws/tools/shutdownUps-1<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>                logger -t upssched-cmd "UPS 1 low battery"<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>                ;;<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>        ups-2-low)<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>                /ws/tools/shutdownUps-2<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>                logger -t upssched-cmd "UPS 2 low battery"<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>                ;;<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>      ups-3-low)<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>                /ws/tools/shutdownUps-3<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>                logger -t upssched-cmd "UPS 3 low battery"<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>                ;;<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>        ups-4-low)<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>                /ws/tools/shutdownUps-4<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>                logger -t upssched-cmd "UPS 4 low battery"<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>                ;;<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>        ups-5-low)<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>                /ws/tools/shutdownUps-5<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>                logger -t upssched-cmd "UPS 5 low battery"<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>                ;;<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>        ups-6-low)<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>                /ws/tools/shutdownUps-6<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>                logger -t upssched-cmd "UPS 6 low battery"<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>                ;;<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>        ups-7-low)<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>                /ws/tools/shutdownUps-7<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>                logger -t upssched-cmd "UPS 7 low battery"<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>                ;;<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>Esac<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'>Scripts like ‘shutdownUPS-N’ do this:<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:1.0in;text-indent:-.25in'><span style='font-family:Symbol;color:#1F497D'>·</span><span style='font-size:7.0pt;font-family:"Times New Roman",serif;color:#1F497D'>        </span><span style='color:#1F497D'>Foreach linux box on the ups, log in and issue “shutdown –h now”<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:1.0in;text-indent:-.25in'><span style='font-family:Symbol;color:#1F497D'>·</span><span style='font-size:7.0pt;font-family:"Times New Roman",serif;color:#1F497D'>        </span><span style='color:#1F497D'>Foreach VMWare server on the ups, log in and issue “/sbin/shutdown.sh && /sbin/poweroff”<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Hope that helps!<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Mike<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma",sans-serif'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma",sans-serif'> Nut-upsuser [<a href="mailto:nut-upsuser-bounces+mike.oshaughnessy=gd-ms.com@lists.alioth.debian.org">mailto:nut-upsuser-bounces+mike.oshaughnessy=gd-ms.com@lists.alioth.debian.org</a>] <b>On Behalf Of </b>Garrett Michael Hayes<br><b>Sent:</b> Tuesday, October 31, 2017 11:10 AM<br><b>To:</b> <a href="mailto:nut-upsuser@lists.alioth.debian.org">nut-upsuser@lists.alioth.debian.org</a><br><b>Subject:</b> [Nut-upsuser] Email Alerts for Multiple UPSs with upssched<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Greetings Gentlebeings,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I have started deploying a number of NUT instances on Raspberry Pi machines (Raspbian Jessie) across my network.  The purpose of these “nutcases” as we refer to them is to monitor the status of the UPSs supporting our network switching infrastructure and notify us of power and battery events via email.  No shutdown or other actions are required.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Everything is going spiffy as all get-out so far.  But now I’m running up against a configuration issue I don’t quite know how to address.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thus far each “nutcase” has been configured to monitor a single UPS.  Now I want to deploy one to monitor three UPSs in a larger switch closet.  Adding the additional UPSs to ups.conf and upsmon.conf is fairly straightforward.  But I’m darned if I can figure out how to configure the email alerts to let me know WHICH UPS is the source of an event.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’m using upssched as my NOTIFYCMD, and it in turn is calling a little shell script that reads the flag that’s passed and sends an email.  What I can’t figure out is how (if there is a way) to determine the originating UPS.  It seems that only the status flag makes it across to the shell script.  Or at least if it’s passing more than that, I don’t know how to retrieve it.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’m sure I must be missing something simple.  Any thoughts/pointers would be appreciated!<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><b><span style='font-size:14.0pt;font-family:"Garamond Premr Pro Smbd",serif'>Garrett Michael Hayes<o:p></o:p></span></b></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>