RE: /usr/bin/printf: %,: invalid directive
"Barry Minnis" <[email protected]>
| Newsgroups | gmane.network.netsaint.user |
|---|---|
| Message-ID | <[email protected]> |
It's been over a year ago since I posted my query to this, and I can't remember why but there was some reason I didn't like going to the echo command like everyone's sugguesting. I fixed it tho by using the following: command[notify-by-email]=/usr/bin/printf "%b%s" '***** NetSaint 0.0.7 *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $DATETIME$\n\nAdditional Info:\n\n$OUTPUT$' | /bin/mail -s '** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **' $CONTACTEMAIL$ paying attention to the location of " and ' characters, as well as the %b%s printf argument. My version of printf (on Redhat 7.2) doesn't even document the %s parameter, but as I recall when I fixed it in June 2001, it needed to be there. You'll also need to change any printf email notification accordingly. Also see my original msg below for an explanation why it's doing this. b -----Original Message----- From: [email protected] [mailto:[email protected]]On Behalf Of Barry Minnis Sent: Thursday, May 24, 2001 6:49 AM To: [email protected] Subject: [netsaint] printf error Does anyone know how to resolve this? Getting an error displayed on the console after ping recoveries: /usr/bin/printf: %,: invalid directive I believe the error lies right here on the 'command[notify-by-email]' line: ... \n\nAdditional Info:\n\n$OUTPUT$' ... That $OUTPUT$ variable would contain: PING WARNING - Packet loss = 0%, RTA = 23.17 ms and it doesn't like the % sign in the variable. That's why in my e-mail notifications the last line is: PING WARNING - Packet loss = 0 with nothing after that. Help? Barry --- -----Original Message----- From: [email protected] [mailto:[email protected]]On Behalf Of Andres L. Figari Sent: Tuesday, September 03, 2002 5:55 PM To: [email protected] Subject: [netsaint] /usr/bin/printf: %,: invalid directive Hi, Dug throught the mailing list emails, I could swear I remeber this but can't find it :( I get a strange little error /usr/bin/printf: %,: invalid directive Netsaint works great, but at times, while in the machine and working with it, it prints oput on the screen LOL Anyone know what this is about? Regards, Andres ------------------------------------------------------- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 _______________________________________________ Netsaint-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/netsaint-users ------------------------------------------------------- In remembrance www.osdn.com/911/