10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
The script below works okay and emails me the log in the end once the script completes but what I'm trying to do is to also notify me via an email as soon as the script encounters any error whatsoever.
cat test.list
hdisk0 00a6351a2c832da1 rootvg ... (7 Replies)
Discussion started by: mbak
7 Replies
2. Shell Programming and Scripting
Hi All
I am trying to write a shell script that will notify via email if a particular service is down. What I have so far is a script in cron like his:
#!/bin/sh
cd /usr/jdk/instances/jdk1.6.0/bin/sparcv9
jps -m
And the output of the above is
81529 Jps
52988 TaskControllerService... (5 Replies)
Discussion started by: fretagi
5 Replies
3. Shell Programming and Scripting
Greetings.
I've come across a bit of a problem with notify-send syntax; and wondered if anyone out there had found a solution in the woodpile somewhere :)
Here's the snippet which is giving me trouble:notify-send 'Text to display' image_data 300, 300, , , , , /etc/image.pngOutput:Invalid... (0 Replies)
Discussion started by: LinQ
0 Replies
4. Shell Programming and Scripting
Hello Team,
I have script which gives below output.
Server clustServer11 is in a STARTED state
Server clustServer12 is in a STOPPED state
Server clustServer21 is in a STOPPED state
I would like to prepare script which will grep stop word from the above output and send an email alert. (5 Replies)
Discussion started by: coolguyamy
5 Replies
5. HP-UX
Hello,
I'm writing to you because I encountered the following problem. My program displayes all network interfaces that are available in the system, but I would like to add a functionality in which a user can enter a destination address IP (ex. the IP address of the Google search engine) and will... (1 Reply)
Discussion started by: foxrafi
1 Replies
6. UNIX for Dummies Questions & Answers
I need to tail -f a file so I can monitor it as it is being written to. However, there is a lot of garbage in the file that I don't care about. So normally I would just pipe and grep for the string that is important to me. However, in this case, there are two things I need to grep for. I can't... (3 Replies)
Discussion started by: Silver11
3 Replies
7. Shell Programming and Scripting
Hi,
I am having a little trouble getting notify-send to work the way I would like it to.
I am using ubuntu - karmic koala 2.6.31-19-generic #56-Ubuntu SMP
So here's the problem
run the following commands one after the other.
notify-send -i info -t 100000 -- "Hi" "world" &
notify-send -i... (3 Replies)
Discussion started by: linuxpenguin
3 Replies
8. Shell Programming and Scripting
Hi,
I am writing a shell script that checks catalina logs on a production system and mails me if it detects errors.
It greps the logs for known errors which i have defined as variables.
The problem is the logs are huge, approx 30,000 before they rotate.
So I am forced to use grep instead... (3 Replies)
Discussion started by: Moxy
3 Replies
9. Shell Programming and Scripting
Hi Experts,
I am trying to write a ksh script that it should notify in case there is no response from the other script. I mean to say that I got a.sh and b.sh
the execution of b.sh depends on a.sh, so if there is no response from a.sh,
b.sh should notify me about the same.
Thanks in Advance (4 Replies)
Discussion started by: rajusa10
4 Replies
10. UNIX for Dummies Questions & Answers
Hi,
I've a question about MINIX OS.
1 - I would like to log the messages that user or kernel process send to each other through the system call send, recv, sendrec and notify.
Since MINIX is a microkernel OS, I suppose that the best way is to have an TCP socket, listening in INADDR_ANY... (0 Replies)
Discussion started by: pedrosacosta
0 Replies
SYSTEMD-NOTIFY(1) systemd-notify SYSTEMD-NOTIFY(1)
NAME
systemd-notify - Notify service manager about start-up completion and other daemon status changes
SYNOPSIS
systemd-notify [OPTIONS...] [VARIABLE=VALUE...]
DESCRIPTION
systemd-notify may be called by daemon scripts to notify the init system about status changes. It can be used to send arbitrary
information, encoded in an environment-block-like list of strings. Most importantly it can be used for start-up completion notification.
This is mostly just a wrapper around sd_notify() and makes this functionality available to shell scripts. For details see sd_notify(3).
The command line may carry a list of environment variables to send as part of the status update.
Note that systemd will refuse reception of status updates from this command unless NotifyAccess=all is set for the service unit this
command is called from.
OPTIONS
The following options are understood:
-h, --help
Prints a short help text and exits.
--version
Prints a short version string and exits.
--ready
Inform the init system about service start-up completion. This is equivalent to systemd-notify READY=1. For details about the semantics
of this option see sd_notify(3).
--pid=
Inform the init system about the main PID of the daemon. Takes a PID as argument. If the argument is omitted, the PID of the process
that invoked systemd-notify is used. This is equivalent to systemd-notify MAINPID=$PID. For details about the semantics of this option
see sd_notify(3).
--status=
Send a free-form status string for the daemon to the init systemd. This option takes the status string as argument. This is equivalent
to systemd-notify STATUS=.... For details about the semantics of this option see sd_notify(3).
--booted
Returns 0 if the system was booted up with systemd, non-zero otherwise. If this option is passed, no message is sent. This option is
hence unrelated to the other options. For details about the semantics of this option, see sd_booted(3).
--readahead=
Controls disk read-ahead operations. The argument must be a string, and either "cancel", "done" or "noreplay". For details about the
semantics of this option see sd_readahead(3).
EXIT STATUS
On success, 0 is returned, a non-zero failure code otherwise.
EXAMPLE
Example 1. Start-up Notification and Status Updates
A simple shell daemon that sends start-up notifications after having set up its communication channel. During runtime it sends further
status updates to the init system:
#!/bin/bash
mkfifo /tmp/waldo
systemd-notify --ready --status="Waiting for data..."
while : ; do
read a < /tmp/waldo
systemd-notify --status="Processing $a"
# Do something with $a ...
systemd-notify --status="Waiting for data..."
done
SEE ALSO
systemd(1), systemctl(1), systemd.unit(5), sd_notify(3), sd_booted(3)
systemd 208 SYSTEMD-NOTIFY(1)