- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script to check if source routing is disabled.
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
09-30-2009 05:59 AM
09-30-2009 05:59 AM
I want to disable source routing-
Please help me with a script to check in HPUX system if source routing is disabled using the avobe option.
only to check.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2009 06:03 AM
09-30-2009 06:03 AM
Re: script to check if source routing is disabled.
Why do you need a script? You need to read the manpages:
# ndd -get /dev/ip ip_forward_src_routed
...returns 0 if disabled.
Regards!
...JRF...
- Tags:
- ndd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2009 06:11 AM
09-30-2009 06:11 AM
Re: script to check if source routing is disabled.
You are right it returns 0 if source routing is disabled but i need to periodically check if source routing is disabled or it is enabled by some other administrator with root previlages.
The script will help me to check if source routing is disabled on the system.
So you this option could be used in the script.:)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2009 06:21 AM
09-30-2009 06:21 AM
Re: script to check if source routing is disabled.
> You are right it returns 0 if source routing is disabled but i need to periodically check if source routing is disabled or it is enabled by some other administrator with root previlages.
OK, so what is "periodically check" [how often] and what do you want to do if it is in an enabled state and/or a disabled state.
You need to be more clear in framing your questions, please.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2009 06:30 AM
09-30-2009 06:30 AM
Re: script to check if source routing is disabled.
I'd have to agree with JRF, we can't figure out what you expect from a script.
But guessing what you want you can do something like this:
#!/bin/bash
retval=$(ndd -get /dev/ip ip_forward_src_routed)
if [ $retval -eq 0 ]; then
sendmail
fi
And just add it to your crontab. If you want to take some kind of action when $retval is 0 you can add that instead of the sendmail line.
Best regards
Fredrik Eriksson
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2009 06:35 AM
09-30-2009 06:35 AM
Re: script to check if source routing is disabled.
@ Fredrik: JRF: how can something be in both an enabled and disabled state? :) *giggle*
Duh, that was silly of me :-)
@ Chicuks:
The suggestion Fredrik gave is fine. Instead of using 'cron' you could also loop continuously; sleeping for some period; waking and testing the state; and looping again. This can be done in a shell script and there are numerous examples of the technique if you search the forum.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2009 09:37 AM
09-30-2009 09:37 AM
Re: script to check if source routing is disabled.
That reminds me of a saying about set theory:
Sets are not like doors, they can be open and closed at the same time.
For software, you can have something that is both enabled and disabled. That would most likely be a bug where something is wedged and two programs think the state is different. :-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2009 12:04 PM
09-30-2009 12:04 PM
Re: script to check if source routing is disabled.
i want a script to check & not for remediation.
The aim is to disable source routing.
& to check if source routing is disabled i need a script
the output of the script should be
source routing disabled = OK
source routing enabled =NOK(not ok)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2009 12:21 PM
09-30-2009 12:21 PM
Solution> ok lemme make it clear again
I would hardly call a one-line command to check a "script". However based on the things already said, you could do:
#!/usr/bin/sh
while true
do
RSLT=$(ndd -get /dev/ip ip_forward_src_routed)
if [ "${RSLT}" = 0 ]; then
MSG="source routing disabled = OK"
else
MSG="source routing enabled =NOK (not ok)"
fi
echo ${MSG}
sleep 300
done
exit 0
...This script, once started, would awaken every 300-seconds and announce what it found. If 'cron'ed, the STDOUT will be mailed to the initiating user. If you want a one-time only check, comment out the loop, like:
#!/usr/bin/sh
#while true
#do
RSLT=$(ndd -get /dev/ip ip_forward_src_routed)
if [ "${RSLT}" = 0 ]; then
MSG="source routing disabled = OK"
else
MSG="source routing enabled =NOK (not ok)"
fi
echo ${MSG}
# sleep 300
#done
exit 0
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2009 12:29 PM
09-30-2009 12:29 PM
Re: script to check if source routing is disabled.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2009 01:23 AM
10-02-2009 01:23 AM