07-10-2013
Hi Guys,
I need a help in nagios notifications setup.
I have a script that will generate alert for w and critical based on a condition.
What I want is that "Nagios should send out an alert for warning only if the condition i.e. written in the script exists for more than an 1hr then. No change is required for critical."
Please help me on this
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello to all...this is my first post (so please go easy). :)
I feel pretty solid at expect scripting, but I'm running into an issue that I'm not able to wrap my head around. I wrote a script that is a little advanced for logging into a remote Linux machine and changing text in a file using sed.... (2 Replies)
Discussion started by: v1k0d3n
2 Replies
2. Shell Programming and Scripting
This Expect script provides expect with a list of IP addresses to Cisco IPS sensors and commands to configure Cisco IPS sensors. The user, password, IP addresses, prompt regex, etc. have been anonymized. In general this script will log into the sensors and send commands successfully but there are... (1 Reply)
Discussion started by: genewolfe
1 Replies
3. Shell Programming and Scripting
I have a really basic expect script which I call from php. I works fine when I run the php from the shell, but from the web it appears as if the output buffer gets chopped and never gets all of the contents.
php script: (runexpect.php)
<?php... (7 Replies)
Discussion started by: jacksona2
7 Replies
4. Shell Programming and Scripting
I've always written scripts where the user executes the script and I prompt them for what they want to do.
But I'm trying to write a script where root executes the script 'lock' or its hard-link 'unlock' and the script will passwd -l or passwd -u an account depending on the choice.
What would... (3 Replies)
Discussion started by: ADay2Long
3 Replies
5. Shell Programming and Scripting
Guys,
I need you help please.
The script below is not working correclty for checking via a awk/if statement . Can you tell me what i am doing wrong in the script code "if($1 == "$RETENTION_LEVEL") "
Syntax
RETENTION_LEVEL=`echo $LINE | cut -f2 -d" "`
echo " ==============... (4 Replies)
Discussion started by: Junes
4 Replies
6. Programming
Hi,
Am very new to expect scripting..
Can You please suggest me how to call an expect script inside another expect script..
I tried with
spawn /usr/bin/ksh
send "expect main.exp\r"
expect $root_prompt
and
spawn /usr/bin/ksh
send "main.exp\r"
expect $root_prompt
Both... (1 Reply)
Discussion started by: Priya Amaresh
1 Replies
7. Programming
I have an expect script called remote that I want to call from inside my expect script called sudoers.push, here is the code that is causing me issues:
set REMOTE "/root/scripts/remote"
...
log_user 1
send_user "Executing remote script as $user...\n"
send_user "Command to execute is: $REMOTE... (1 Reply)
Discussion started by: brettski
1 Replies
8. Shell Programming and Scripting
Hi guys,
I’m looking for an automatic way to save the source code of an website to a file. My questions is, it is possible to control elinks from a script, pipe or cli? I need to open a website, login on this site by a webform, submit the form, open an new url and save the source code of a... (2 Replies)
Discussion started by: digg_de
2 Replies
9. Programming
I'm fairly new to scripting so this might not be possible.
I am using Expect with Cisco switches and need to capture the string after finding the expect request. For example, when I issue "show version" on a Nexus switch, I'm looking to capture the current firmware version:
#show version
... (0 Replies)
Discussion started by: IBGaryA
0 Replies
10. UNIX for Beginners Questions & Answers
Hi; problem may be obvious, simple but I have to say it is somehow not easy to locate the issue.
I am doing some word extracting from multiline text.
Interacting in CLI seems to work without issues. First step is to add multiline text to a variable.
expect1.1>
expect1.1> set... (2 Replies)
Discussion started by: aldowski
2 Replies
LEARN ABOUT DEBIAN
nagircbot
NAGIRCBOT(1) General Commands Manual NAGIRCBOT(1)
NAME
nagircbot - announce Nagios status to an IRC channel
SYNOPSIS
nagircbot [-CdeHmRStxX] [-A REGEX] [-c CHANNEL] [-f FILE] [-F HOST[:PORT]] [-i INTERVAL] [-I INTERVAL] [-k KEYWORD] [-n NICK] [-N PREFIX]
[-p PASSWORD] [-P FILE] [-s HOST[:PORT]] [-T LIST] [-u USERNAME] [-U NAME] [-z USER]
DESCRIPTION
nagircbot is an IRC bot that reads Nagios' status information and emits alerts to an IRC channel. It can filter alerts based on severity
(CRITICAL, HARD, SOFT, and/or UNKNOWN) or by regular expression. It can connect to IRC servers protected by password or SSL, and can
optionally set the topic to the current Nagios status.
OPTIONS
-A REGEX
Filter (omit) lines that match a basic regular expression.
-c CHANNEL
Channel to connect to, including the leading "#" (default: "#nagircbot").
-C Use colors in IRC messages.
-d Do not fork into the background.
-e Use encryption (SSL) when connecting to the IRC server.
-f FILE
Path to Nagios' status.log, indicated by the 'status_file' parameter in nagios.cfg (default: "/usr/local/nagios/var/status.log").
-F HOST[:PORT]
Retrieve status.log over the network. If no port is specified, the default is 33333.
-H Only announce alerts in 'HARD' state. This is the default.
-i INTERVAL
Nagios alert check interval, in seconds (default: 60).
-I INTERVAL
How often to announce Nagios global status in the channel, in seconds. Specify an interval of 0 (the default) to disable. Do not
specify an interval smaller than the alert check (-i) interval.
-k KEYWORD
Keyword for the channel (default: no keyword).
-m Display status information for an alert in separate IRC messages instead of combining on a single message.
-n NICK
IRC nick to use (default: "nagircbot").
-N PREFIX
Prefix for all in-channel IRC messages.
-p PASSWORD
IRC server password.
-P FILE
Write PID file.
-R Only announce CRITICAL/UNKNOWN alerts.
-s HOST[:PORT]
IRC server to connect to. If not specified, the default is "localhost:6667". If no port is specified, the default is 33333.
-S Also announce alerts in 'SOFT' state.
-t Set the channel topic to an alert summary.
-T LIST
Enable checks to see if Nagios is still running. Send 'check' in a private message to invoke the check. Accepts a comma-seperated
list (without spaces) with the following elements: max_time_last_host_update, max_time_oldest_host_update, max_time_last_host_check,
max_time_oldest_host_check, max_time_last_service_check, max_time_oldest_service_check, and max_time_oldest_next_service_check.
-u USERNAME
Username to log into the IRC server as.
-U NAME
IRC "real" or full name (default: "nagircbot").
-x status.log is in Nagios 1.0 format.
-X status.log is in Nagios 2.0/3.0 format. This is the default.
-z USER
User to run as.
AUTHOR
nagircbot was written by Folkert van Heusden <folkert@vanheusden.com>.
This manual page was written by John Morrissey <jwm@horde.net>, for the Debian project (and may be used by others).
December 13, 2010 NAGIRCBOT(1)