User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 456,450 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,613 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums
Views: 2822 | Replies: 8 | Solved
Reply
Join Date: Oct 2007
Posts: 5
Reputation: 18041980 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
18041980 18041980 is offline Offline
Newbie Poster

need script for solaris

  #1  
Dec 4th, 2007
I need script for pinging the machines in subnet make list of alive hosts with there OS version redirected in a file. I am from System admin field and not aware of scripting and also beginner of UNIX.

Thanks in advance.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2007
Location: Frederick, MD
Posts: 4
Reputation: t_rectenwald is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 2
t_rectenwald's Avatar
t_rectenwald t_rectenwald is offline Offline
Newbie Poster

Re: need script for solaris

  #2  
Dec 4th, 2007
The best way for you to do this would be to use nmap, http://insecure.org/nmap/ and wrap a shell script around that utility. Make sure that your company is okay with you doing that first though; nmap is often used for less constructive activities.

nmap can ping entire subnets, and do limited OS type lookups as well. See if you can get a hold of it, if not post a reply and we'll see what we can do with shell.

Regards,
Tom
Reply With Quote  
Join Date: Oct 2007
Posts: 5
Reputation: 18041980 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
18041980 18041980 is offline Offline
Newbie Poster

Re: need script for solaris

  #3  
Dec 5th, 2007
Originally Posted by t_rectenwald View Post
The best way for you to do this would be to use nmap, http://insecure.org/nmap/ and wrap a shell script around that utility. Make sure that your company is okay with you doing that first though; nmap is often used for less constructive activities.

nmap can ping entire subnets, and do limited OS type lookups as well. See if you can get a hold of it, if not post a reply and we'll see what we can do with shell.

Regards,
Tom



Thanks tom I will try that and get back to you if couldn't work. appreciated your your quick responce.

Thanks & Regards
Amit
Reply With Quote  
Join Date: Oct 2007
Posts: 5
Reputation: 18041980 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
18041980 18041980 is offline Offline
Newbie Poster

Re: need script for solaris

  #4  
Dec 5th, 2007
Originally Posted by 18041980 View Post
Thanks tom I will try that and get back to you if couldn't work. appreciated your your quick responce.

Thanks & Regards
Amit



I tried making file it throws error
make: Fatal error in reader: Makefile, line 1: Badly formed macro assignment
This error occur for export command i am sending Makefile code below
============================================
export NMAP_VERSION = 4.20
NMAP_NAME= Nmap
NMAP_URL= http://insecure.org
NMAP_PLATFORM=sparc-sun-solaris2.10
prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
sbindir = ${exec_prefix}/sbin
mandir = ${prefix}/man
srcdir = .
nmapdatadir = ${prefix}/share/nmap
deskdir = $(prefix)/share/applications

export NBASEDIR=nbase
export NSOCKDIR=nsock
CC = gcc
CXX = g++
CCOPT =
DBGFLAGS =
LIBPCAPDIR = libpcap
LIBPCREDIR = libpcre
export LIBDNETDIR = libdnet-stripped
DEFS = -DHAVE_CONFIG_H -DNMAP_VERSION=\"$(NMAP_VERSION)\" -DNMAP_NAME=\"$(NMAP_NAME)\" -DNMAP_URL=\"$(NMAP_URL)\" -DNMAP_PLATFORM=\"$(NMAP_P
LATFORM)\" -DNMAPDATADIR=\"$(nmapdatadir)\"
# For mtrace debugging -- see MTRACE define in main.cc for instructions
# Should only be enabled during debugging and not in any real release.
# DEFS += -DMTRACE=1
CXXFLAGS = -Ilibdnet-stripped/include -Ilibpcre -Ilibpcap -Inbase -Insock/include $(DBGFLAGS) $(CCOPT) $(DEFS)
CPPFLAGS =
# CFLAGS = $(CXXFLAGS)
# CFLAGS = $(DEFS) $(INCLS)
STATIC =
LDFLAGS = -Llibpcap -Lnbase -Lnsock/src/ $(DBGFLAGS) $(STATIC)
LIBS = -lnbase -lnsock libpcre/libpcre.a -lpcap libdnet-stripped/src/.libs/libdnet.a -lposix4 -lsocket -lnsl -lm
# LIBS = -lefence -lposix4 -lsocket -lnsl -lm
# LIBS = -lrmalloc -lposix4 -lsocket -lnsl -lm
SHTOOL = ./shtool
INSTALL = $(SHTOOL) install
MAKEDEPEND = @MAKEDEPEND@
export RPMTDIR=$(HOME)/rpm


# DESTDIR is used by some package maintainers to install Nmap under
# its usual directory structure into a different tree. See the
# CHANGELOG for more info.
DESTDIR =

TARGET = nmap
TARGETNMAPFE=nmapfe/nmapfe
INSTALLNMAPFE=install-nmapfe

export SRCS = main.cc nmap.cc targets.cc tcpip.cc nmap_error.cc utils.cc idle_scan.cc osscan.cc osscan2.cc output.cc scan_engine.cc timing.c
c charpool.cc services.cc protocols.cc nmap_rpc.cc portlist.cc NmapOps.cc TargetGroup.cc Target.cc FingerPrintResults.cc service_scan.cc Nma
pOutputTable.cc MACLookup.cc nmap_tty.cc nmap_dns.cc

export HDRS = charpool.h FingerPrintResults.h global_structures.h idle_scan.h MACLookup.h nmap_amigaos.h nmap_dns.h nmap_error.h nmap.h Nmap
Ops.h NmapOutputTable.h nmap_rpc.h nmap_tty.h nmap_winconfig.h osscan.h osscan2.h output.h portlist.h protocols.h scan_engine.h service_scan
.h services.h TargetGroup.h Target.h targets.h tcpip.h timing.h utils.h

OBJS = main.o nmap.o targets.o tcpip.o nmap_error.o utils.o idle_scan.o osscan.o osscan2.o output.o scan_engine.o timing.o charpool.o servic
es.o protocols.o nmap_rpc.o portlist.o NmapOps.o TargetGroup.o Target.o FingerPrintResults.o service_scan.o NmapOutputTable.o MACLookup.o nm
ap_tty.o nmap_dns.o

# %.o : %.cc -- nope this is a GNU extension
.cc.o:
$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
all: $(TARGET) $(TARGETNMAPFE)

$(TARGET): $(DEPS) $(LIBPCAPDIR)/libpcap.a libpcre/libpcre.a libdnet-stripped/src/.libs/libdnet.a $(NBASEDIR)/libnbase.a $(NSOCKDIR)/src/lib
nsock.a $(OBJS)
@echo Compiling nmap
rm -f $@
$(CXX) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)

# This empty rule is used to force execution of certain rules where I can't conveniently specify
# all of the prerequisites (e.g. recursive makes and such)
FORCE:

$(LIBPCREDIR)/libpcre.a: $(LIBPCREDIR)/Makefile FORCE
@echo Compiling libpcre; cd $(LIBPCREDIR) && $(MAKE)

$(LIBDNETDIR)/src/.libs/libdnet.a: $(LIBDNETDIR)/Makefile FORCE
@echo Compiling libdnet; cd $(LIBDNETDIR) && $(MAKE)

$(LIBPCAPDIR)/libpcap.a: $(LIBPCAPDIR)/Makefile FORCE
@echo Compiling libpcap; cd $(LIBPCAPDIR) && $(MAKE)

$(NBASEDIR)/libnbase.a: $(NBASEDIR)/Makefile FORCE
@echo Compiling libnbase;
cd $(NBASEDIR) && $(MAKE)

$(NSOCKDIR)/src/libnsock.a: $(NSOCKDIR)/src/Makefile FORCE
@echo Compiling libnsock;
cd $(NSOCKDIR)/src && $(MAKE)

#$(LIBPCAPDIR)/Makefile:
# @echo Configuring libpcap; cd $(LIBPCAPDIR); ./configure
nmapfe/nmapfe:
# @echo "FAILURES HERE ARE OK -- THEY JUST MEAN YOU CANNOT USE nmapfe"
# -rm -f nmapfe/Makefile
# -cd nmapfe; ./configure;
@if test -f nmapfe/Makefile; then echo "Building NmapFE graphical frontend"; cd nmapfe && $(MAKE) VERSION=$(NMAP_VERSION); else echo
"NmapFE will not be made -- your system lacks the capabilities (perhaps GTK) for this graphical frontend. You can still run command-line n
map!"; fi
# -cd nmapfe; test -f Makefile && $(MAKE) VERSION=$(NMAP_VERSION) STATIC=$(STATIC);
# @echo "END OF SECTION WHERE FAILURES ARE OK"

# Make a statically compiled binary for portability between distributions
static:
$(MAKE) STATIC=-static

debug:
$(MAKE) DBGFLAGS="-O0 -g -pg -ftest-coverage -fprofile-arcs"

# Make the Nmap tarball
distro:
cd dev && $(MAKE) distro

# Update the web site
web:
cd dev && $(MAKE) web

clean: pcap_clean pcre_clean dnet_clean nmapfe_clean nsock_clean nbase_clean my_clean

my_clean:
rm -f dependencies.mk
rm -f $(OBJS) $(TARGET) config.cache
pcap_clean:
-cd $(LIBPCAPDIR) && $(MAKE) clean
pcre_clean:
pcre_clean:
-cd $(LIBPCREDIR) && $(MAKE) clean
dnet_clean:
-cd $(LIBDNETDIR) && $(MAKE) clean
nmapfe_clean:
-cd nmapfe && $(MAKE) clean
nbase_clean:
-cd $(NBASEDIR) && $(MAKE) clean
nsock_clean:
-cd $(NSOCKDIR)/src && $(MAKE) clean
pcap_dist_clean:
-cd $(LIBPCAPDIR) && $(MAKE) distclean
pcre_dist_clean:
-cd $(LIBPCREDIR) && $(MAKE) distclean
dnet_dist_clean:
-cd $(LIBDNETDIR) && $(MAKE) distclean
nmapfe_dist_clean:
-cd nmapfe && $(MAKE) distclean
nbase_dist_clean:
-cd $(NBASEDIR) && $(MAKE) distclean
nsock_dist_clean:
-cd $(NSOCKDIR)/src && $(MAKE) distclean
debugclean:
rm -f *.gcov *.gcda *.gcno gmon.out

distclean: my_clean my_distclean pcap_dist_clean pcre_dist_clean dnet_dist_clean nmapfe_dist_clean nbase_dist_clean nsock_dist_clean

my_distclean:
rm -f Makefile Makefile.bak makefile.dep config.h stamp-h stamp-h.in \
config.cache config.log config.status

install-nmap: $(TARGET)
$(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(nmapdatadir)
$(INSTALL) -c -m 755 -s nmap $(DESTDIR)$(bindir)/nmap
$(INSTALL) -c -m 755 -s nmap $(DESTDIR)$(bindir)/nmap
$(INSTALL) -c -m 644 docs/$(TARGET).1 $(DESTDIR)$(mandir)/man1/$(TARGET).1
$(INSTALL) -c -m 644 docs/nmap.xsl $(DESTDIR)$(nmapdatadir)/
$(INSTALL) -c -m 644 docs/nmap.dtd $(DESTDIR)$(nmapdatadir)/
$(INSTALL) -c -m 644 nmap-services $(DESTDIR)$(nmapdatadir)/
$(INSTALL) -c -m 644 nmap-rpc $(DESTDIR)$(nmapdatadir)/
$(INSTALL) -c -m 644 nmap-os-fingerprints $(DESTDIR)$(nmapdatadir)/
$(INSTALL) -c -m 644 nmap-os-db $(DESTDIR)$(nmapdatadir)/
$(INSTALL) -c -m 644 nmap-service-probes $(DESTDIR)$(nmapdatadir)/
$(INSTALL) -c -m 644 nmap-protocols $(DESTDIR)$(nmapdatadir)/
$(INSTALL) -c -m 644 nmap-mac-prefixes $(DESTDIR)$(nmapdatadir)/

install-nmapfe: $(TARGETNMAPFE)
$(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(nmapdatadir) $(DESTDIR)$(deskdir)
@echo "If the next command fails -- you cannot use the X front end"
-test -f nmapfe/nmapfe && $(INSTALL) -c -m 755 -s nmapfe/nmapfe $(DESTDIR)$(bindir)/nmapfe && rm -f $(DESTDIR)$(bindir)/xnmap && $(S
HTOOL) mkln -f -s $(DESTDIR)$(bindir)/nmapfe $(DESTDIR)$(bindir)/xnmap && $(INSTALL) -c -m 644 nmapfe.desktop $(DESTDIR)$(deskdir)/nmapfe.de
sktop && $(INSTALL) -c -m 644 docs/nmapfe.1 $(DESTDIR)$(mandir)/man1/nmapfe.1 && $(INSTALL) -c -m 644 docs/xnmap.1 $(DESTDIR)$(mandir)/man1/
xnmap.1

install: install-nmap $(INSTALLNMAPFE)

uninstall:
rm -f $(bindir)/$(TARGET) $(bindir)/nmapfe $(bindir)/xnmap
rm -f $(deskdir)/nmapfe.desktop $(mandir)/man1/nmapfe.1
rm -f $(mandir)/man1/xnmap.1 $(mandir)/man1/nmap.1
rm -rf $(nmapdatadir)

${srcdir}/configure: configure.ac
cd ${srcdir} && autoconf

## autoheader might not change config.h.in, so touch a stamp file.
#${srcdir}/config.h.in: stamp-h.in
#${srcdir}/stamp-h.in: configure.ac acconfig.h \
# config.h.top config.h.bot
# cd ${srcdir} && autoheader
# echo timestamp > ${srcdir}/stamp-h.in
#
#config.h: stamp-h
#stamp-h: config.h.in config.status
# ./config.status

Makefile: Makefile.in config.status
./config.status

config.status: configure
./config.status --recheck

makefile.dep:
$(CXX) -MM $(CXXFLAGS) $(CPPFLAGS) $(SRCS) > $@
include makefile.dep
Reply With Quote  
Join Date: Oct 2007
Posts: 306
Reputation: eggi is on a distinguished road 
Rep Power: 2
Solved Threads: 29
eggi eggi is offline Offline
Posting Whiz

Re: need script for solaris

  #5  
Dec 5th, 2007
Are you using gnu make or the one that comes with solaris? I think your issue might have to do with what "make" you're using

Best wishes,

, Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
Having trouble passing cert exams? Check out How To Pass Any Computer Certification Test!
Reply With Quote  
Join Date: Oct 2007
Posts: 5
Reputation: 18041980 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
18041980 18041980 is offline Offline
Newbie Poster

Re: need script for solaris

  #6  
Dec 5th, 2007
Originally Posted by eggi View Post
Are you using gnu make or the one that comes with solaris? I think your issue might have to do with what "make" you're using

Best wishes,

, Mike


I am using make comes with solaris /usr/ccs/bin/make is there any other tool that can be downloaded.


Amit
Reply With Quote  
Join Date: Nov 2007
Location: Frederick, MD
Posts: 4
Reputation: t_rectenwald is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 2
t_rectenwald's Avatar
t_rectenwald t_rectenwald is offline Offline
Newbie Poster

Re: need script for solaris

  #7  
Dec 5th, 2007
I'm an HP-UX/AIX/Linux guy, and don't have a whole lot of experience with Solaris. However, I think you can just install nmap as a precompiled package and not have to worry about running make. Check out: http://www.sunfreeware.com for the nmap package. Also, if you want to compile from source, the Solaris instructions are here: http://insecure.org/nmap/install/inst-solaris.html.

Best Regards,
Tom
Reply With Quote  
Join Date: Oct 2007
Posts: 306
Reputation: eggi is on a distinguished road 
Rep Power: 2
Solved Threads: 29
eggi eggi is offline Offline
Posting Whiz

Re: need script for solaris

  #8  
Dec 6th, 2007
Also, as a pre-compiled binary, if you want to do your own compiles, gnu make is an alternative (if not better) make than the one that comes with Solaris. ...in my opinion

, Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
Having trouble passing cert exams? Check out How To Pass Any Computer Certification Test!
Reply With Quote  
Join Date: Oct 2007
Posts: 5
Reputation: 18041980 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
18041980 18041980 is offline Offline
Newbie Poster

Re: need script for solaris

  #9  
Dec 6th, 2007
Originally Posted by eggi View Post
Also, as a pre-compiled binary, if you want to do your own compiles, gnu make is an alternative (if not better) make than the one that comes with Solaris. ...in my opinion

, Mike

hey tom/ Mike
thanks a lot for helping out for this as per tom i got pkg on sunfreeware no need to compile it gave me libissl error i sorted out that noe it is working fine. thanks guys u both are great and appreciate ur help and prompt reply.


Thanks
Amit
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Shell Scripting Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Shell Scripting Forum

All times are GMT -4. The time now is 1:58 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC