Sponsored Content
Top Forums Shell Programming and Scripting Need script help for monitoring duplex settings Post 302785411 by lutador72 on Monday 25th of March 2013 04:22:25 PM
Old 03-25-2013
Quote:
Originally Posted by verdepollo
Seems the speed isn't changing in any case but only the duplex mode. Since you already have ethtool available, here's a start:
Code:
DUPLEX=$(ethtool eth0 | sed -n 's/Duplex:\(.*\)/\1/p')
if [ $DUPLEX = Full ]
then
   # Do something
elif [ $DUPLEX = Half ]
   # Do something else
fi

This is just the starting point I need. Thank you so much! I'll plug in the parameters I need and post the results!

---------- Post updated at 01:22 PM ---------- Previous update was at 11:30 AM ----------

Pardon my lack of knowledge here but I seem to be getting syntax errors with the "fi" at the end of the file? I tried running the dos2linux command to ensure there are no weird characters at the end of the file. Am I missing something within?

starbuck:/home/acc4000d # ./duplex72
./duplex72: line 8: syntax error near unexpected token `fi'
./duplex72: line 8: `fi'


Code:
#!/bin/sh
DUPLEX=$(ethtool eth0 | sed -n 's/Duplex:\(.*\)/\1/p')
if [ $DUPLEX = Full ]
then
   echo "All is good in the neighborhood"
elif [ $DUPLEX = Half ]
    echo "Check eth0 settings, I am at 100 half duplex. Do IT NOW!!!"
fi

 

10 More Discussions You Might Find Interesting

1. Solaris

Duplex Settings

Hi All I've been having a lot of errors logged on the Cisco Catalyst (4000 series) which one of my Solaris servers is patched into. I have a feeling they are duplex related, but I'm a bit stuck as to how to confirm that. How do I: 1. Check the duplex settings on my eri0 card? 2. Set the... (3 Replies)
Discussion started by: saabir
3 Replies

2. HP-UX

command to change duplex settings..

Hi Folks, I want the command to change the duplex settings of a HP-UX server. Thanks in advance. Sagar. (2 Replies)
Discussion started by: sag71155
2 Replies

3. IP Networking

Automated script to assign TCP/IP settings automatically after unintentionally unplug

Yesterday i had a situation that cause me headache for a while , I have a web server running win2k3 it has 2 NIC's one of them assigned to public area network and the other is not functioning The place where the server is , is messy and cables on the floor so any one can stumble with ... (2 Replies)
Discussion started by: h@foorsa.biz
2 Replies

4. Solaris

Solaris 10 Speed and Duplex Settings: bge

Evening, I am attempting to change the speed and duplex settings on a single interface on a bge card on an m3000 SPARC server. Currently the settings are as follows: bge0 link: up speed: 1000 Mbps duplex: full bge1 link: up speed: 100 Mbps ... (13 Replies)
Discussion started by: brialt1
13 Replies

5. Solaris

How to find half duplex or full duplex

Hi, How to find whether the server is running with half duplex or full duplex. I tried with the following command ndd -get /dev/ but am not getting any output,. Is the command correct? Also let me know how to change from half to full duplex. (1 Reply)
Discussion started by: rogerben
1 Replies

6. Solaris

Duplex Script - output format issue.

Hi Gurus, I had downloaded the below script from the net and used it to get the Link and duplex settings in my Sun servers. In all except one(Sol-5.10 on X86) i am getting output format like below: root: /var/ADMIN/bin/speed_duplex.sh Interface Speed Duplex --------- ... (2 Replies)
Discussion started by: Hari_Ganesh
2 Replies

7. Shell Programming and Scripting

Script to adjust network settings

Hello, Newbie question on scripting - I'm looking to create a simple script that will work on RHEL5 that will adjust the network settings: ip address, default gateway, and subnet mask. If anything else needs to be done (service network stop / start) or should be done to make settings active - I... (4 Replies)
Discussion started by: rojizo
4 Replies

8. Shell Programming and Scripting

Write a shell script security policy settings for linux

The pro help! Write a shell script setup for linux security policies include: 1. login (username and password login). 2. add, delete your username and password. 3. firewall. Note: Write a shell script file as follows: If login successful then Step 2. If step 2 succeeds (ie add,... (1 Reply)
Discussion started by: ngovuongbinhtay
1 Replies

9. UNIX for Advanced & Expert Users

ldapsearch in monitoring script without bind password written in script

Hi I do a very simple monitoring of our OpenLDAP (runs in cronjob and generate alerts if unsuccessfull) $ ldapsearch -h hostname.domain -D "cn=monitor_user,ou=People,dc=organisation" -w "password" -b "dc=organisation" -x "(&(cn=monitor_user)(ou=People))" dn | grep -v version dn:... (4 Replies)
Discussion started by: slashdotweenie
4 Replies

10. Shell Programming and Scripting

Configuring smtp settings and then sending the mail through shell script

I have make an menu in which first option is to start and second is to stop the services echo "Please enter the appropriate choice for doing the operations" echo " 1) STOP Services 2) START Services case $choice in 1) ... (1 Reply)
Discussion started by: punpun66
1 Replies
TXP(4)							   BSD Kernel Interfaces Manual 						    TXP(4)

NAME
txp -- 3Com 3XP Typhoon/Sidewinder (3CR990) Ethernet interface SYNOPSIS
To compile this driver into the kernel, place the following line in your kernel configuration file: device txp Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5): if_txp_load="YES" DESCRIPTION
The txp interface provides access to the 10Mb/s and 100Mb/s Ethernet networks via the 3Com Typhoon/Sidewinder chipset. Basic Ethernet functions are provided as well as support for vlan(4) tag removal and insertion assistance, receive ip(4), tcp(4), and udp(4) checksum offloading, and transmit ip(4) checksum offloading. There is currently no support for transmit tcp(4) or udp(4) checksum offload- ing, tcp(4) segmentation, nor ipsec(4) acceleration. When a txp interface is brought up, by default, it will attempt to auto-negotiate the link speed and duplex mode. The speeds, in order of attempt, are: 100Mb/s Full Duplex, 100Mb/s Half Duplex, 10 Mb/s Full Duplex, and 10 Mb/s Half Duplex. The txp supports several media types, which are selected via the ifconfig(8) command. The supported media types are: media autoselect Attempt to autoselect the media type (default) media 100baseTX mediaopt full-duplex Use 100baseTX, full duplex media 100baseTX [mediaopt half-duplex] Use 100baseTX, half duplex media 10baseT mediaopt full-duplex Use 10baseT, full duplex media 10baseT [mediaopt half-duplex] Use 10baseT, half duplex HARDWARE
The txp driver supports the following cards: o 3Com 3CR990-TX-95 o 3Com 3CR990-TX-97 o 3Com 3cR990B-TXM o 3Com 3CR990SVR95 o 3Com 3CR990SVR97 o 3Com 3cR990B-SRV SEE ALSO
altq(4), arp(4), inet(4), intro(4), ip(4), miibus(4), tcp(4), udp(4), vlan(4), ifconfig(8) HISTORY
The txp driver first appeared in OpenBSD 2.9. BSD
January 26, 2012 BSD
All times are GMT -4. The time now is 03:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy