Sponsored Content
Full Discussion: Daily health check script
Top Forums Shell Programming and Scripting Daily health check script Post 302686499 by fretagi on Tuesday 14th of August 2012 05:33:44 PM
Old 08-14-2012
Daily health check script

Hi

I am still learning how to write shell scripts, so I started to write a script like this:
Code:
#!/bin/sh
date 
echo
outputOK () {
  echo $1 "[ ok ]"
}

outputOK () {
  echo $1 "[ warning ]"
}

for vol in `/usr/bin/grep -E 'hfs|vxfs|nfs|cifs' /etc/fstab | egrep -v '^#' | awk '{ print $3 }'`
do
if bdf    $vol | grep $vol > /dev/null
then
 outputOK "Filesystem: $vol    mounted"
 else    outputW  "Filesystem: $vol    NOT MOUNTED"
fi
done

But when I run, I got the following:

Code:
bdf: vxfs: No such file or directory
Filesystem: vxfs NOT MOUNTED [ Warning ]

Can you help

FR
 

10 More Discussions You Might Find Interesting

1. HP-UX

check health

Dear Gentelmen I need command for display to me the following statement: -battery state -The application if working or not -The cpu is working or not -The power supply is working or not -The Data base is workig or not (2 Replies)
Discussion started by: magasem
2 Replies

2. Shell Programming and Scripting

need help to write script to check the process health and automatically restart it

I am working on a project, which need to constantly watch the process, and check its status, if it was dead, it should be restart automatically. Please kindly refer me to URL which teach how to write this kind of script, or service. Thanks. (1 Reply)
Discussion started by: dragondad
1 Replies

3. AIX

AIX Health Check

Hi All, I would like to know if there is a downloadable AIX health check script available from IBM that would print a report of a servers health status. I've been working on a number of Sun Solaris servers and Sun provide a sun checkup script which can give you an ORI figure as well as a list... (3 Replies)
Discussion started by: backslash
3 Replies

4. Shell Programming and Scripting

Health check script

Hi, I have a server type(A group of AIX,HP-UX and Linux servers running with different appn) in which i need to do health check(memory,cpu,h/w etc). I am planning to automate the same. Please help me out in writing the same. Thanks Renjesh Raju (9 Replies)
Discussion started by: Renjesh
9 Replies

5. AIX

AIX Health Check script

Hi Everyone, Can you please help me put together a aix health check script that will check the status of CPU,Memory,Adapter, Filesystems (threshold 80%) and Disks.Im thinking of deploying a script to gather the required data in all the 22 servers and probably send out a mail if anything needs... (3 Replies)
Discussion started by: R!C
3 Replies

6. Shell Programming and Scripting

Health check script

There are 3 servers . I want to fire commands df -kh and mpstat -P ALL on those individual servers and retrieve particular values to genrate reports. This part is almost done. But i am facing issue when i need to compile the reports from all three servers on to one server in order to generate a... (1 Reply)
Discussion started by: pratikm23
1 Replies

7. HP-UX

HP-UX Health Check

Hi Experts, I want to check health of hp-ux box. Basically I want to check if there are possibilities of network/memory/cpu bottleneck? Are there are any commands available other than glance in hp-ux for the same? (11 Replies)
Discussion started by: sai_2507
11 Replies

8. Shell Programming and Scripting

Script to check the health of a database

need a script to check the health of a session server database. It must read the data base and send an alert if the database is unavailable. If its unavailable, we will want to bring down the database listener to force failover. can u guyz help me in doing this. what information do i need... (1 Reply)
Discussion started by: remo999
1 Replies

9. Shell Programming and Scripting

Health check report

Hi Team, I am writing a small script in that I want collect all servers of /opt and /stage. Below is my small script #!/bin/ksh #checking Media server opt_Disk_Space_logs myclient=`cat media_server.txt` > opt_logs.txt printf " Server Name\tsize\tused\tavail\tcapacity\tMounted... (12 Replies)
Discussion started by: bashi77
12 Replies

10. AIX

AIX Health Check

Hi everyone, I am new to the Unix admin position, needed some help. My management wants to report how their over all AIX servers / environment is doing so far. I've been researching and found multiple commands to run on each LPAR, well I have few questions and also wanted to share the commands Im... (12 Replies)
Discussion started by: Adnans2k
12 Replies
volfs(7FS)							   File Systems 							volfs(7FS)

NAME
volfs - Volume Management file system DESCRIPTION
volfs is the Volume Management file system rooted at root_dir. The default location for root-dir is /vol, but this can be overridden using the -d option of vold (see vold(1M)). This file system is maintained by the Volume Management daemon, vold, and will be considered to be /vol for this description. Media can be accessed in a logical manner (no association with a particular piece of hardware), or a physical manner (associated with a particular piece of hardware). Logical names for media are referred to through /vol/dsk and /vol/rdsk. /vol/dsk provides block access to random access devices. /vol/rdsk provides character access to random access devices. The /vol/rdsk and /vol/dsk directories are mirrors of one another. Any change to one is reflected in the other immediately. The dev_t for a volume will be the same for both the block and character device. The default permissions for /vol are mode=0555, owner=root, group=sys. The default permissions for /vol/dsk and /vol/rdsk are mode=01777, owner=root, group=sys. Physical references to media are obtained through /vol/dev. This hierarchy reflects the structure of the /dev name space. The default per- missions for all directories in the /vol/dev hierarchy are mode=0555, owner=root, group=sys. mkdir(2), rmdir(2), unlink(2) (rm), symlink(2) (ln -s), link(2) (ln), and rename(2) (mv) are supported, subject to normal file and direc- tory permissions. The following system calls are not supported in the /vol filesystem: creat(2), only when creating a file, and mknod(2). If the media does not contain file systems that can be automatically mounted by rmmount(1M), users can gain access to the media through the following /vol locations: +-----------------------------------+------------------------------------+ | Location | State of Media | +-----------------------------------+------------------------------------+ |/vol/dev/diskette0/unnamed_floppy | formatted unnamed floppy-block | | | device access | +-----------------------------------+------------------------------------+ |/vol/dev/rdiskette0/unnamed_floppy | formatted unnamed floppy-raw | | | device access | +-----------------------------------+------------------------------------+ |/vol/dev/diskette0/unlabeled | unlabeled floppy-block device | | | access | +-----------------------------------+------------------------------------+ |/vol/dev/rdiskette0/unlabeled | unlabeled floppy-raw device access | +-----------------------------------+------------------------------------+ |/vol/dev/dsk/c0t6/unnamed_cdrom | CD-ROM-block device access | +-----------------------------------+------------------------------------+ |/vol/dev/rdsk/c0t6/unnamed_cdrom | CD-ROM-raw device access | +-----------------------------------+------------------------------------+ For more information on the location of CD-ROM and floppy media, see System Administration Guide: Basic Administration or rmmount(1M). Partitions Some media support the concept of a partition. If the label identifies partitions on the media, the name of the media becomes a directory with partitions under it. Only valid partitions are represented. Partitions cannot be moved out of a directory. For example, if disk volume 'foo' has three valid partitions, 0, 2, and 5, then: /vol/dsk/foo/s0 /vol/dsk/foo/s2 /vol/dsk/foo/s5 for block access and /vol/rdsk/foo/s0 /vol/rdsk/foo/s2 /vol/rdsk/foo/s5 for character access. If a volume is relabeled to reflect different partitions, the name space changes to reflect the new partition layout. A format program can check to see if there are others with the volume open and not allow the format to occur if it is. Volume Management, however, does not explicitly prevent the rewriting of a label while others have the volume open. If a partition of a volume is open, and the volume is relabeled to remove that partition, it will appear exactly as if the volume were missing. A notify event will be generated and the user may cancel the operation with volcancel(1), if desired. SEE ALSO
volcancel(1), volcheck(1), volmissing(1) rmmount(1M), vold(1M), rmmount.conf(4), vold.conf(4) System Administration Guide: Basic Administration SunOS 5.10 8 Feb 1995 volfs(7FS)
All times are GMT -4. The time now is 04:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy