- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- tcpip script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2005 08:47 AM
08-16-2005 08:47 AM
I want know a script so that the output of the below mentioned commands gets recorded in a file:
egrep 'maxfiles|maxfiles_lim' /stand/system
ndd -get /dev/tcp tcp_conn_request_max
ndd -get /dev/tcp tcp_ip_abort_interval
Appreciate if anyone can suggest the script ?
Thanks,
Shiv
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2005 08:50 AM
08-16-2005 08:50 AM
Re: tcpip script
Do the following..
#script /tmp/info.txt
Script started, file is /tmp/info.txt
#egrep 'maxfiles|maxfiles_lim' /stand/system
#ndd -get /dev/tcp tcp_conn_request_max
#ndd -get /dev/tcp tcp_ip_abort_interval
#exit
Script done, file is /tmp/info.txt
Hope this helps.
Regards,
Syam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2005 08:52 AM
08-16-2005 08:52 AM
Solution*********
#!/usr/bin/sh
grep maxfiles /stand/system >> /var/tmp/yourfile
echo "" >> /var/tmp/yourfile
ndd -get /dev/tcp tcp_conn_request_max >> /var/tmp/yourfile
echo "" >> /var/tmp/yourfile
ndd -get /dev/tcp tcp_ip_abort_interval >> /var/tmp/yourfile
**********
Save the file as something like myscript.sh and make it executable (chmod 700 myscript.sh).
Now run it:
# ./myscript.sh
When it finishes look at the file /var/tmp/yourfile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2005 08:54 AM
08-16-2005 08:54 AM
Re: tcpip script
MYLOGFILE=somefilename
date >> $MYLOGFILE
egrep 'maxfiles|maxfiles_lim' /stand/system >> $MYLOGFILE
ndd -get /dev/tcp tcp_conn_request_max >> $MYLOGFILE
ndd -get /dev/tcp tcp_ip_abort_interval >> $MYLOGFILE
echo "--------------------------------------" >> $MYLOGFILE #separator line
just put all of the above into a file called mytcpipscript,
chmod 755 mytcpipscript
and if you want to run it lets say every hour, add the following into your crontab:
00 * * * * * /path/to/mytcpipscript
hope this helps
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2005 09:01 AM
08-16-2005 09:01 AM
Re: tcpip script
# (
> egrep 'maxfiles|maxfiles_lim' /stand/system;
> ndd -get /dev/tcp tcp_conn_request_max;
> ndd -get /dev/tcp tcp_ip_abort_interval
) > outfile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2005 09:10 AM
08-16-2005 09:10 AM
Re: tcpip script
#!/usr/bin/sh
echo "Max_Files">>/tmp/info.txt
echo "*************">>/tmp/info.txt
egrep 'maxfiles|maxfiles_lim' /stand/system>>/tmp/info.txt
echo "\n\n">>/tmp/info.txt
echo "tcp_conn_request_max">>/tmp/info.txt
echo "*************************">>/tmp/info.txt
ndd -get /dev/tcp tcp_conn_request_max>>/tmp/info.txt
echo Abort_Interval">>/tmp/info.txt
echo ""************************">>/tmp/info.txt
ndd -get /dev/tcp tcp_ip_abort_interval>>/tmp/info.txt
echo "******************* NEXT *********************\n">>/tmp/info.txt
The above is tested and OK. You may put this in cron and use it.
Regards,
Syam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2005 09:12 AM
08-16-2005 09:12 AM
Re: tcpip script
# (
> egrep 'maxfiles|maxfiles_lim' /stand/system;
> echo "tcp_conn_request_max: \c";
> ndd -get /dev/tcp tcp_conn_request_max;
> echo "tcp_ip_abort_interval: \c";
> ndd -get /dev/tcp tcp_ip_abort_interval;
> ) > outfile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2005 09:20 AM
08-16-2005 09:20 AM
Re: tcpip script
Sorry No pts for my last post...There was some typing mistake.
the following will work for you with the time stamp.
#!/usr/bin/sh
date>>/tmp/info.txt
echo "">>/tmp/info.txt
echo "Max_Files">>/tmp/info.txt
echo "*************">>/tmp/info.txt
egrep 'maxfiles|maxfiles_lim' /stand/system>>/tmp/info.txt
echo "">>/tmp/info.txt
echo "tcp_conn_request_max">>/tmp/info.txt
echo "*************************">>/tmp/info.txt
ndd -get /dev/tcp tcp_conn_request_max>>/tmp/info.txt
echo "">>/tmp/info.txt
echo "Abort_Interval">>/tmp/info.txt
echo "************************">>/tmp/info.txt
ndd -get /dev/tcp tcp_ip_abort_interval>>/tmp/info.txt
echo "">>/tmp/info.txt
echo "******************* NEXT *********************\n">>/tmp/info.txt
Regards,
Syam