Sponsored Content
Top Forums Shell Programming and Scripting Help with delaying script and implementing checks before completion Post 302999356 by tomeurp on Monday 19th of June 2017 08:19:08 AM
Old 06-19-2017
Thank you sooo much for your prompt response.

I'll surely give it a try and let you know how it went although I might not be able to fully test it for a couple of weeks since I have this set up in a remote location and I need to be able to unplug the ups to test it.

Thanks again Smilie

---------- Post updated 19-06-17 at 02:19 PM ---------- Previous update was 18-06-17 at 02:29 PM ----------

Thank you very much @RudiC it works perfectrly well!

I forgot to mention that the main script was a python script and I could not integrate your code directly. Instead, I have placed it on a separate .sh which handles the logic for either calling or not calling based on the status of the UPS after 10 seconds and I call that one from the main script.

Thanks againSmilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script that checks for previous instances running

Hello, I'm trying to write a script that checks for previous instances of the same script which may still be running (this script is scheduled to run every 30 minutes). I want to somehow use the pid from each instance to make sure the previous one isn't running before continuing with my... (5 Replies)
Discussion started by: bd_joy
5 Replies

2. Solaris

Sendmail error delaying relay

When I try to send mail, sendmail delays a lot. After monitoring syslog, I noticed that sendmail starts with this first message... waits a minute and gives the second message... waits another minute and then sends off the email. How do I correct this in sendmail or completly disable it. I'm sending... (0 Replies)
Discussion started by: adelsin
0 Replies

3. Shell Programming and Scripting

Script to perform record format checks

Hi All, I have a requirement to perform the following checks. Input file is a "|" delimited file and looks like this. A|c1|c2|c3|.... B|G1|G2|G3.... C|H1|H2|H3... A|c4|c5|c6|.... B|G4|G5|G6.... C|H4|H5|H6... Now the check is to see if all the "A" records have a corresponding B... (7 Replies)
Discussion started by: gsjdrr
7 Replies

4. Shell Programming and Scripting

Perl script that checks against Future time

Ok, so this may be an unusual request. But I have a certificate that expires sometime in may of 2011. Now, i have to monitor this certificate and alert when the current time is within 30 days of may 20, 2011. #!/usr/bin/perl # use Time::Local; # $sec=59; $min=59; $hours=23; $day=31;... (3 Replies)
Discussion started by: SkySmart
3 Replies

5. Shell Programming and Scripting

[Bash] MD5 Checks with Script.

Hi. I'm triyng to make a Bash Script that checks (recursively) the MD5 from all the files in a certain directory and compare them against some other check that should be already done and saved in a file. I've reached to the point where i have the MD5 from the file and the MD5 that the script... (1 Reply)
Discussion started by: BiFo
1 Replies

6. Shell Programming and Scripting

Script to performs checks

Hi , I need a script which performs below activity I have one file named "testfile" in 9 different directories with same name. I want to perform below action with each testfile of each directory. if ; then mv listfiles listfiles_`date +%b%y` else echo No Such files fi ... (4 Replies)
Discussion started by: sv0081493
4 Replies

7. Shell Programming and Scripting

Script to do the following checks

Hi , I need a script for processing below scenario. I have to check daily by doing ftp IP to check it is logging or not. So i want this activity to be automated such that if login succesful i will get "FTP LOGIN SUCCESS" in a log file and if fails i want the error message in the same log... (1 Reply)
Discussion started by: sv0081493
1 Replies

8. Shell Programming and Scripting

Help with implementing available memory status script

hi , i want write the script which automatically send an alert mail to my mail id when there is low memory available. things which i am able to implement -: i got the output of current memory status into one file . Than i break down the required coloumn and again send it in another file. My... (1 Reply)
Discussion started by: abhinav dixit
1 Replies

9. Shell Programming and Scripting

Script function which checks if itself is already running

Hi All, I have a cron job set up which is set to run every 10 seconds. What I need to do is have the script do a check to see if it is already running such that if it is running it wont fire up additional instances and processes according to its normal process. For example if I have a script... (4 Replies)
Discussion started by: landossa
4 Replies

10. Solaris

Sendmail delaying mails for 45 mins

Hi, I'm trying to send out mails from my server using mailx, however everytime I send one, it appears to be held in the /var/spool/mqueue for 44 mins before being sent. I'm quite new to sendmail, so don't really know where to start with this /var/log/syslog displays the following: Dec 16... (4 Replies)
Discussion started by: badoshi
4 Replies
DUMMY-UPS(8)							    NUT Manual							      DUMMY-UPS(8)

NAME
dummy-ups - Driver for multi-purpose UPS emulation NOTE
This man page only documents the specific features of the dummy-ups driver. For information about the core driver, see nutupsdrv(8). DESCRIPTION
This program is a multi-purpose UPS emulation tool. Its behavior depends on the running mode: Dummy Mode dummy-ups looks like a standard device driver to upsd(8) and allows one to change any value for testing purposes. It is both interactive, controllable through the upsrw(1) and upscmd(1) commands (or equivalent graphical tool), and batchable through script files. It can be configured, launched and used as any other real driver. This mode is mostly useful for development and testing purposes. Repeater Mode dummy-ups acts as a NUT client, simply forwarding data. This can be useful for supervision purposes. This can also allow some load sharing between several UPS instances, using a point-to-point communication with the UPS. IMPLEMENTATION
The port specification depends on the running mode, and allows the driver to select the right mode. Dummy Mode Port is a definition file name for dummy-ups. This can either be an absolute or a relative path name. In the latter case the NUT sysconfig directory (ie /etc/nut, /usr/local/ups/etc, ...) is prepended. For instance: [dummy] driver = dummy-ups port = evolution500.dev desc = "dummy-ups in dummy mode" This file is generally named "something.dev". It contains a list of all valid data and associated values, and has the same format as an upsc(8) dump (<varname>: <value>). So you can easily create definition files from an existing UPS using "upsc > file.dev". It can also be empty, in which case only a basic set of data is available: device., driver., ups.mfr, ups.model, ups.status Samples definition files are available in the "data" directory of the nut source tree, and generally in the sysconfig directory of your system distribution. Since dummy-ups will loop on reading this file, you can dynamically modify it to interact with the driver. This will avoid message spam into your system log files, if you are using NUT default configuration. You can also use the "TIMER <seconds>" instruction to create scheduled events sequences. For example, the following sequence will loop on switching ups.status between "OL", "OB" and "OB LB" every minute: ups.status: OL TIMER 60 ups.status: OB TIMER 60 ups.status: LB TIMER 60 It is wise to end the script with a TIMER. Otherwise dummy-ups will directly go back to the beginning of the file. Repeater Mode Port is the name of a remote UPS, using the NUT form, ie: <upsname>[@<hostname>[:<port>]] For instance: [repeater] driver = dummy-ups port = ups@hostname desc = "dummy-ups in repeater mode" INTERACTION
Once the driver is loaded in dummy mode, you can change any variables, except those of the driver.* and server.* collections. You can do this by either editing the definition file, or use the upsrw(1) and upscmd(1) commands. Note that in simulation mode, new variables can be added on the fly, by adding these to the definition file. Conversely, if you need to remove variable (such as transient ones, like ups.alarm), simply update these by setting an empty value. As a result, they will get removed from the data. In repeater mode, the driver acts according to the capabilities of the UPS, and so support the same instant commands and settable values. BACKGROUND
This driver was written in one evening to replace the previous dummycons testing driver. It was too limited and required to work from a terminal to interact. dummy-ups is useful for NUT client development, and other testing purpose. It also helps the NUT Quality Assurance effort, by automating some tests on the NUT framework. It now offers a repeater mode. This will help in building the Meta UPS approach, which allows one to build a virtual device, composed of several other devices (either UPS, PDUs). BUGS
Instant commands are not yet supported in Dummy Mode, and data need name/value checking enforcement, as well as boundaries or enumeration definition. AUTHOR
Arnaud Quette SEE ALSO
upscmd(1), upsrw(1), ups.conf(5), nutupsdrv(8) Internet Resources: The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ Network UPS Tools 05/21/2012 DUMMY-UPS(8)
All times are GMT -4. The time now is 06:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy