Sponsored Content
Top Forums Shell Programming and Scripting Monitor some of network services Post 302985776 by mohsen1366 on Tuesday 15th of November 2016 06:20:27 AM
Old 11-15-2016
it Solved

I write this script and it does work

Code:
#!/bin/bash
while  true
do

tcpdump -i ETH1  port 9996  >  /home/log_netflow &
pid=$!
sleep 5
kill $pid
count=`cat /home/log_netflow | wc -l `
echo $count

if  [ $count  -gt 2 ] ;  then

echo " system is working "   >>  /home/service_status

else

echo "system is down "   >>  /home/service_status
/etc/init.d/netflowd  restart
fi

done



Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 11-15-2016 at 07:33 AM.. Reason: Changed [B] to CODE tags.
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Long Delay if any with network services

While installing a firewall, I was pinging the interface from SCO 5.0.6 Openserver box, while no response, I hit "DEL" to cancel, but no cancel. Then all of a sudden I get BOO-KOO traffic lights on HUB and Switch.... Then a kernel trap error. System froze... Proceeded with a cold boot. Now I have... (8 Replies)
Discussion started by: nashvillek5
8 Replies

2. IP Networking

stopping and starting network services

Solaris v5.6 how do you stop and start the network services? (4 Replies)
Discussion started by: Westy564
4 Replies

3. UNIX for Dummies Questions & Answers

Search for network services

OK I am a complete newbie to Unix. We have a Sunfire V890 running SUNOS Release 5.9. The Operating Environment is Solaris 9. I have been tasked with determining whether or not specific network and solaris services are enabled or disabled. If the services are enabled I need to disable them. I'm... (12 Replies)
Discussion started by: coachgt1
12 Replies

4. HP-UX

how can I get network services

Hi Is there a cmd in hpux 11 to get the network services the network services must display "Listen" like command netstat -an |grep Listen and display the process that is running on a port in HP-Unix at the same time my request can not use lsof -i command,not to install any extral... (2 Replies)
Discussion started by: alert0919
2 Replies

5. Programming

Help in developing a Network Appliation to monitor pc in a network

I am developing a Network Appliation to monitor computers in a network. Specs are App monitors the current web page viewed in each system App also can shutdown the computer in the network App can show all process run by each computer in the network I am now confused how to start my... (2 Replies)
Discussion started by: valaparambil88
2 Replies

6. IP Networking

Oracle network services

i have installd oracle 10 on Solaris 10 now i want to access this database from remote machine. -bash-3.00$ tnsping 192.168.92.49 TNS Ping Utility for Solaris: Version 10.2.0.2.0 - Production on 17-DEC-2010 21:06:51 Copyright (c) 1997, 2005, Oracle. All rights reserved. Used... (0 Replies)
Discussion started by: akhaliq22
0 Replies

7. AIX

How to monitor websphere services down?

if websphere services is down, any unix command or scripts can send alert? (1 Reply)
Discussion started by: rainbow_bean
1 Replies

8. Shell Programming and Scripting

Monitor the services by script

I developed for monitoring the network connections among the branch servers as I given below as script.But I don't know how to monitor the services through network script whether the services is running or not. eg : I want to check the postgres service for all the branch servers through network... (0 Replies)
Discussion started by: kannansoft1985
0 Replies

9. IP Networking

I would like to monitor network traffic for a computer on my network

My son does homework on a school laptop. I was thinking about setting up a gateway on my home network, so that I can monitor web traffic and know if he is doing his homework without standing over his shoulder. Ideally I would like to use the Raspberry Pi Model b that I already have. However, I... (15 Replies)
Discussion started by: gandolf989
15 Replies
LBCDCLIENT(1)							   User Commands						     LBCDCLIENT(1)

NAME
lbcdclient - Query a remote lbcd daemon for system load SYNOPSIS
lbcdclient [-2] [-s service[,service ...]] host ... DESCRIPTION
lbcdclient sends a query packet to a remote lbcd server and prints the results. The result output will look something like this: btime 1092858021 ctime 1092960298 utime 1092955199 load l1 96 l5 69 l15 57 total 0 unique 0 console 0 tmp full 0 P_tmpdir full 2 services 0 pads 0 0 service 0: weight 1 increment 1 btime is the time of the last system boot in seconds since epoch. ctime is the current system time in seconds since epoch. utime is the last modification time of the information about logged in users in seconds since epoch. The load line gives the one-minute (l1), five-minute (l5), and fifteen-minute (l15) load averages, multiplied by 100. The next line gives the count of logged-in users. total gives the count of all logged-in users, unique lists the total number of unique users, and console is 1 if a user is logged in to the console of the system. tmp full is the percentage used in the system /tmp directory and P_tmpdir full is the percentage full in the system /var/tmp directory. Finally, the last lines give information for each service, using the extended service response for the version three packet format. The first line gives the count of number of configured services minus one. (The pads numbers are reserved space in the packet and will gener- ally always be zero.) Then, each subsequent line lists the weights and increments for each service lbcd is monitoring on the system. If the -2 option is used, lbcdclient will send a version two packet instead, and the returned results will not include the services line and everything after that. OPTIONS
-2 Send a version two protocol packet instead of a version three packet. Version two doesn't support the separate service weights. -s service,[service ...] Request information for the specified service names. It's not entirely clear whether this works correctly. SEE ALSO
lbcd(8) The current version of this program is available from its web page at <http://www.eyrie.org/~eagle/software/lbcd/>. AUTHORS
Written by Larry Schwimmer. Currently maintained by Russ Allbery <rra@stanford.edu>. 3.3.0 2006-10-06 LBCDCLIENT(1)
All times are GMT -4. The time now is 04:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy