I do not have bash handy but for ksh which is very similar -
If nounset is on you will get what you requested, errors on undefined variables, and error checking for syntax only with noexec on.
I have a rather big script that i have written in ksh and it is falling over in two places with a 'test argument' error. I know this usually means that the if statement is not correct, but it is fine. I have looked through the rest of the script for any odd brackets or ` marks, but can't see... (2 Replies)
could any one provide me any new real time project idea in shell scripting
i am learning shell script and wants to do some real time development . (1 Reply)
Hi Folks. I am currently working on a script that has to spell check a file and print the output to the screen in 2 columns like this.
INCORRECT CORRECTION
whio who
weahter weather
The file will allow the user to override the ispell command and save any... (9 Replies)
I'm trying to write a small utility for syntax checking. I've tried using Flex/Bison, but these seem too advanced for my task. A simpler tool would be appreciated. (1 Reply)
I have written little script to check the CPU performance of the machine.
Request you to contribute your comments on the same.
Feel free to add your own scriptlet to make it better.
I have decided to call it as doctortux
I have decided to run the script in two mode
1)Interactive.(Not... (4 Replies)
hai guys,
I'am a newbie to this forum and to unix as well...as a part of our syllabus i got a project in Unix which i have to do in 4 days.Project is kinda File locking i will give the project specs...guys please help me..
Established client-server architecture using socket... (1 Reply)
hai guys,
I'am a newbie to this forum and to unix as well...as a part of our syllabus i got a project in Unix which i have to do in 4 days.Project is kinda File locking i will give the project specs...guys please help me..
Established client-server architecture using socket... (1 Reply)
I have a majority of this problem done but seem to be struggling on the last couple of steps. Here is the whole problem to help you guys get a better understanding.
Write a shell script that implements a simple spell checker.
The filename you will use for your script will be your Z-id followed... (1 Reply)
I am attempting to write a korn shell script that does the following, but I am getting errors. I'm new to korn shell scripting and am not sure what I am doing wrong. Please help with example scripts. Thanks.
1) check for day of the week
2) if day of the week is Monday then check for the... (4 Replies)
Discussion started by: ijmoore
4 Replies
LEARN ABOUT DEBIAN
upslog
UPSLOG(8) NUT Manual UPSLOG(8)NAME
upslog - UPS status logger
SYNOPSIS
upslog -h
upslog [OPTIONS]
DESCRIPTION
upslog is a daemon that will poll a UPS at periodic intervals, fetch the variables that interest you, format them, and write them to a
file.
The default format string includes variables that are supported by many common UPS models. See the description below to make your own.
OPTIONS -h
Display the help message.
-f format
Monitor the UPS using this format string. Be sure to enclose format in quotes so your shell doesn't split it up. Valid escapes within
this string are:
%%
Insert a single "%"
%TIME format%
Insert the time with strftime formatting
%ETIME%
Insert the number of seconds, ala time_t. This is now a 10 digit number.
%HOST%
insert the local hostname
%UPSHOST%
insert the host of the UPS being monitored
%PID%
insert the pid of upslog
%VAR varname%
insert the value of variable varname
The default format string is:
%TIME @Y@m@d @H@M@S% %VAR battery.charge% %VAR input.voltage%
%VAR ups.load% [%VAR ups.status%] %VAR ups.temperature%
%VAR input.frequency%
-i interval
Wait this many seconds between polls. This defaults to 30 seconds.
If you require tighter timing, you should write your own logger using the upsclient(3) library.
-l logfile
Store the results in this file.
You can use "-" for stdout, but upslog will remain in the foreground.
-s ups
Monitor this UPS. The format for this option is upsname[@hostname[:port]]. The default hostname is "localhost".
-u username
If started as root, upsmon will setuid(2) to the user id associated with username for security.
If username is not defined, it will use the value that was compiled into the program. This defaults to "nobody", which is less than
ideal.
SERVICE DELAYS
The interval value is merely the number given to sleep(3) after running through the format string. Therefore, a query will actually take
slightly longer than the interval, depending on the speed of your system.
LOG ROTATION
upslog writes its PID to upslog.pid, and will reopen the log file if you send it a SIGHUP. This allows it to keep running when the log is
rotated by an external program.
SEE ALSO
Server:
upsd(8)
Clients:
upsc(8), upscmd(8), upsrw(8), upsmon(8)
Internet resources:
The NUT (Network UPS Tools) home page: http://www.networkupstools.org/
Network UPS Tools 05/21/2012 UPSLOG(8)