Today's Page Hits: 62
This page validates as XHTML 1.0, and will look much better in a browser that supports web standards, but it is accessible to any browser or Internet device. It was created using techniques detailed at glish.com/css/.
OpenSolaris Installfest @ BMSCE, Bangalore
We are hosting a installfest at BMSCE, Bangalore.
Moinak Ghosh, who is the moderator for BOSUG(Bangalore Open Solaris User Group) organizing this event. The details as follows :
Venue: BMS College Of Engg. 100-seater Auditorium.
Date: Saturday 28th April
Time: 10AM onwards
Agenda:
10:00 AM - 10:30 AM
A quick demo of the Install Process
10:30 AM - 11:15 AM
A demo of the post-install configuration and some Jazzy stuff like
Compiz 3D Desktop on Solaris.
11:15 AM onwards
Troubleshooting and Installing machines
Trisha, BMSCE SUN Campus Ambassador who is helping Moinak in organizing this event. Thanks to CSE HOD and BMS staff who are helping us in organizing this event. We are grateful to the cooperation
from BMS college without which arranging this would have been difficult.
Posted at 08:11AM Apr 27, 2007 by G S Hiregoudar in Solaris |
Beijing Trip report
I reached Beijing on April 15th evening.
My first interaction/meeting with Jason Tong in the morning 10AM. We discussed lot about university engagements, opensolaris adoption and collaborations with Indian universities and the Professors.
I had to rush for a meeting with my SEED Mentor Mike Hayden at 11:15AM. I discussed with Mike about CA activities in India and also about university engagements. Later we had lengthy discussions about collobarations and the challenges. We went out for a lunch.
In the afternoon I had a extended meeting with Jason and later met Joey and spoke about
* Opensolaris adoption
* Faculty training
* CA activities
* Best practices which we have adopted in India
* Sharing the experiences and the challenges in university scenario both in China and India
In the evening, Joey organized an event, so I had to rush towards Peking University. Tracy and Lisa CA from Beijing took me to Peking university.
The session strated at 7PM. I started my talk on
* showing sun videos
* Sun Academic initiative
* Open Source and licensing
* Opensolaris and its features
* Hands on lab(SMF and zones)
The session went
upto 9:00PM, the details about the event, please refer to
my
blog
http://blogs.sun.com/ganesh/entry/visit_to_peking_university_beijing
April 18th to
19th
China ERC(Education and Research Conference). CERC started with Scott's keynote, he spoke about Curriki(curriculum development webpage which is open sourced)
Kim Jones spoke about education 3.0 and lots of insight about education and research.
Raju Buddharaju from Singapore digital library spoke about library system.
In the side lines of the conference, I met Dinesh Bahl and discussed about CA activities in India and also the best practices which we have implemented.
Also spoke about how we can scale this program in India. Dinesh gave lot of ideas about this program.
Also met other dignitaries, Chinese professors and other CAs from Beijing.
In the evening I came back to ERI and had an opportunity to attend Scott's townhall meeting.
On 19th, David
Yen spoke about storage systems. Mark Hamilton spoke about systems practice
solutions. Later Sin Yaw, site lead Beijing addressed the student
panel.
I happened to
attend Edu Summit at ERI in the afternoon, lot of dignitaries were attended.
All the stakeholders of university programs in China did participate in
the meeting. Jason Tong presented to the group about FY07 highlights and
plan for FY08. Shrenik Mehta spoke about opensparc
initiatives.
After that we had a lengthy discussion with Shrenik about how we can evangelise opensparc in china and India.
Later we had a
meeting with Kim Jones along with CAs from Beijing. We discussed
about CA activities. Cindy mentioned to Dinesh about issues/high
lights which we can think for FY08.
After that meeting we went out for dinner.
20th April
Joey took me to Tsinghua University to take an interview to the Professor Xiang Yong who is OS Professor.
We discussed about
* involvement of opensolaris source code analysis project
* solaris textbook writing
* OS teaching situation in China
* opensolaris advantages in teaching operating system courses
* the collaboration with sun to drive the opensolaris adoption in chinese universities
* university situation and the teaching of operating system in India
* the possible approaches to collaborate with Indian professors on opensolaris project such as
- writing textbooks
- training
- conferences
- colloborative research
* about initiatives taken towards university engagements from Sun
The discussion went about an hour and shared lot of useful information. Its always nice to interact with Professors.
After I had a
luch on meeting with Cindy and Joey, we discussed about
CA activities and
later it extended in the evening. We shared lot of best practices which
we follow. It was quite useful.
I had a meeting
with Sin Yaw and updated about CA activities in India and also spoke about
Live CD/Live USB. He is quite excited about this. We discussed about
university engagements and colloborations.
Later in the
evening we went to Chinese Academy of Sciences. Joey organized
a Beijing OSUG.
JDS team showed lot of cool demos. I spoke about
* SAI
* open source and licensning
* opensolaris and its features
* Hands on approach(SMF and zones)
It went upto 22:15hrs, students are patiently listening all the sessions. Lots of queries and lots of give aways too.
During weekend I visited forbidden city, temple of heaven and summer palace.
Beijing CAs are quite helpful and supportive. Hats off to all of them.
Overall it was a great trip to Beijing.
Posted at 10:04PM Apr 26, 2007 by G S Hiregoudar in Solaris | Comments[3]
Visit to Peking University, Beijing
Cindy organized an event at Peking University on Monday 16th April.
I gave a talk on opensolaris to Peking University students in Beijing, China. I went to the university along with two CAs(Tracy and Lucy). I met Meredith, CA from Peking Univ. and also opensource community member Zachary. The talk started exactly at 19:00hrs. I've started my discussion by showing some videos about Sun and participation age.
Later I discussed about
* Sun Academic Initiative
* Sun academic developer program
* Open source and licensing
* OpenSolaris and its features(dtrace, ZFS, SMF, zones...)
* Live CDs/Live USBs
* Hands on usage of SMF, zones and pools
30 students were attended the talk. Finally I got very good and interesting questions on ZFS, SMF and containers. Also one student asked about is opensolaris can be installed on mac OS ?
The discussion went up to 21:00hrs. I found very good talented students in Peking university, I'm sure if they get little support we can do lot better. All the attendees were aware about Linux.
Special thanks to Tracy and Lucy for their wonderful support.
Students are listening the talk very interestingly.
Showing the demonstration.
Peking University campus,
Posted at 01:01AM Apr 17, 2007 by G S Hiregoudar in Solaris | Comments[1]
Contributing to opensolaris
Visit the following website for details, this has very good document about the contribution to opensolaris.
http://everburning.com/news/contributing-to-opensolaris/
Posted at 08:26AM Mar 07, 2007 by G S Hiregoudar in Solaris |
Techfest @ MIT Chennai
Our campus ambassador, Sreedhar from MIT Chennai reports about the event which they have conducted at their campus.
============================================
Carte blanche ’07 has turned out to be a huge success. I take this opportunity to share our experience.
The kind of people who visited our stall ranged from school students to
systems engineering professionals in the industry. We briefed about the
operating system concepts to school children and explained the endian
problem briefly. They were listening very keenly and appreciated our
efforts.
We had a couple of students from neighboring engineering colleges. Their
interest in solaris OS and its unique features was overwhelming. We told
them features like ZFS, Dtrace and zoning and also about the Niagara
architecture(as some of them were interested in microprocessors). As a
demo we showed how to write a Dscript and run it. We showed the
organization of probes and how the Dtrace system actually works. We also
explained about the modular architecture of the solaris kernel and the
differences between solaris and linux and the occasions were one beats
another.
It gives me immense pleasure in sharing some of the feedbacks we recvd
for our demo.
- I m a system admin in a leading organization. I feel this is excellent
information on solaris features.
- Wonderful lecture about advantages of open solaris.
- The demo was informative.
- Very informative and clear explanation.
- Cool to hear that you are using solaris(this was by a linux geek).
In addition to this several college students were eager to know how we
could make it up to learn solaris. We then explained them about SAI and
we gave them the link to join it as well. They were very much satisfied
by the advantages of SAI and have promised to talk with their faculty
and getting involved in the program. We also had a couple of people who
needed information on sun training and certification. As the information
pamphlet was remaining with me, I could explain the different programs
.We also distributed a pamphlet to a student who was very interested.
Finally to sum up our stall was a real crowd puller and had a great
response from the visitors. I feel proud to share about this rocking OS
with people and I wish that people in my college appreciate it truly and
use it extensively.
Our team:
Sreedhar GS
Ruban M
Karthick K
====================================================
Great Sreedhar, keep up the great work.
Posted at 08:15AM Mar 07, 2007 by G S Hiregoudar in Solaris |
OpenSolaris Starter Kit
Global distribution of the new OpenSolaris Starter Kit is now live at http://get.opensolaris.org/. There is also a link to the kit on the front page of opensolaris.org. The kit contains tutorials, docs, community distributions, source code, and tools all delivered on two DVDs for free.
Posted at 07:21AM Mar 01, 2007 by G S Hiregoudar in Solaris |
Launch of Hyderabad Open Solaris User Group
We are lauching a Hyderabad Open Solaris User Group at the Intrernational convention center, Hyderbad after the SunTech Days event which starts at 6:30PM to 8PM. There is going to be a talk on opensolaris and its features and the speach from community speakers about the contribution and the participation. Be there.
Posted at 10:49AM Feb 21, 2007 by G S Hiregoudar in Solaris |
Links to Solaris multiboot environment
Following are links containing information on multiboot'ing using the
OpenSolaris GRUB boot loader.
http://www.sun.com/bigadmin/features/articles/grub_boot_solaris.html
http://www.sun.com/bigadmin/features/articles/multiboot_laptop.html
[N.B : Make note
of the entries from menu.lst of linux so that they can be updated in
Solaris GRUB]
http://multiboot.solaris-x86.org/
This is also a very good resource.
Please visit my blog for announcements and the activities on university programs in India.
Posted at 06:16AM Jan 31, 2007 by G S Hiregoudar in Solaris |
FOSS.in 2006 is over
One of the biggest event of FOSS.in(Free Open Source Software) 2006 has been come to an end on 26th Nov evening. 25th Nov saturday was "Sun day", you might be wondering whats this? We had lots of talks, BOF sessions, house full of demo stalls explaining about Sun technologies. This event just a Sun event this time as most of the crowd very enthu about knowing Sun technologies. Its huge success.
Many people across industries who visited our stalls talking about Sun, press also covered most of this event. Overall it was very good event as we showcased our technologies.
Next we have big event coming up in Hyderbad, India which is "Sun Tech Days 2007", stay tuned for the details.
Posted at 09:00PM Nov 26, 2006 by G S Hiregoudar in Solaris | Comments[1]
FOSS.in 2006 conference
FOSS.in 2006 conference is being held from Nov 24th to 26th 2006 in Indian Institue of Science(JN Tata Auditorium), Bangalore, one of the premier institute in India. BangLinux was its original name, from last year onwards this has been renamed to FOSS - Free Open Source Software. Sun being platinum sponsor this year too and we had great FOSS event last time. This time also under the leadership of Sumitha, Joe and couple of others lead from the front and prepared lots of things.
Day 1
We are showing the following cool demos
- Virtualization on OpenSolaris
This includes zones, branded zones, xen, qemu
- ZFS
- Sun Grid
- FMA - Fault Management Agent
- Looking glass, Belenix(LiveCD OpenSolaris distro from IEC)
- Glassfish
- OpenJDK, portal server and so on
Lots of BOF sessions are lined up, first day we had couple of dTrace BOF sessions.
Handouts being distributed on the Sun technologies. Also there is a quiz contest being
organized by Ananth. quiz contest
Lots of interest in the student, developer communities. Pleople used to ask questions related to how do I contribute? Can I get a help if I'm stuck? Students ask on how about projects ?. There is whole lot of enthusiasm across the community.
NAL(National Aerospace Laboratories), one of the premier organization in Bangalore, India. One of the executive from NAL came to the booth and asking about solaris and its technologies. He was more interested to know about virtulization. During our discussion it turned out to be replacing all his boxes by solaris which solvs his lots of problems. Totally he was very excited and told me that he is bringing some other persons from NAL tomorrow to know more about our technologies. We need to tap this market as well as there is lots of growth and potential in such premier organizations.
Thats it. more is coming later. Stay tuned.
Posted at 04:26PM Nov 24, 2006 by G S Hiregoudar in Solaris |
GTLC conference
I had an opportunity to attend two days GTLC(Global Technology
Leadership Conference) held in Le-Meridian on July 25th and 26th 2006.
First day we had a presentations followed by discussions from customers
about the issues of Sun's products.
Topics were :
- Data management : Growth target area(challenges and opportunities)
- Panel : Tidal wave of data challenges
- Business integration
- Challenges of identity management
- Open source: Adoption and challenges
- Indian IT industry growth comapred to global IT industry
Second day was started with Greg's video speech who could not attend the
conference. He presented about technology focus areas
Technology focus areas :
- Horizontal scale
- Storage services
- simple web services
- identity and security
- runs best on Sun
Discussions were around the above said focus areas and also come up with a
objectives among the participants.
Also we had couple of discussions on
- "Global Engineering Leadership Challenges"
- Intelligent Storage
- Composite Application Platform
- Real time Java
We had an opportunity to meet our DEs in the event. Overall this was
very good event which we've attended.
Posted at 12:31AM Jul 28, 2006 by G S Hiregoudar in Solaris |
SMF commands demo
Information Gathering Commands
==============================
svcs(1) and inetadm(1M)
svcs -a Show the state of all the services on the system
svcs -l <FMRI> Show detailed information about a service instance
svcs -d <FMRI> Show the dependencies for a given service instance
svcs -D <FMRI> Show the dependents for a given service instance
svcs -p <FMRI> Show the process ID for a given service instance
svcs -x [FMRI] Explain why a service instance has failed
svcs -v [FMRI] Show verbose information for a given service instance
inetadm -l <FMRI> Show detailed information about an inetd service
FMRI - Fault Management Resource Identifier
Administration Commands
=======================
svcadm(1M) and inetadm(1M)
svcadm enable <FMRI> Attempt to enable a given service
svcadm disable [-t] <FMRI> Disable a given service (temporarily, until next
reboot)
svcadm restart <FMRI> Restart a given service
svcadm refresh <FMRI> Re-read the configuration information in the
repository for the given service
svcadm mark <state> <FMRI> Manually put a service into a maintenance or
degraded state
svcadm clear <FMRI> Once a fault on a service has been repaired,
clear the maintenance/degraded state and inform
the restarter
svcadm milestone <mstone> | all Enable/disable the services for the milestone
you wish to move to. If the all keyword is used
then temporarily enable all services.
inetadm -e <FMRI> Attempt to enable a given inetd based service
inetadm -d <FMRI> Disable a given inetd based service
Configuration Commands
======================
svccfg(1M), svcprop(1) and inetadm(1M)
The svccfg command is used for manipulating data in the repository (properties,
snapshots, etc) and uses sub-commands to perform the various actions. Some
common sub-commands are:
select <FMRI> Select a service or instance to work on
list Show the children of a selected service
listprop List the properties for a given service or
service instance
setprop <property> = <value> Assign a new value to a given property
delete <FMRI> Delete a service from the repository. Avoid
deleting instances unless you really need to as
this can cause problems when reimporting a
manifest
validate <manifest.xml> Validate a manifest before importing into the
repository. See also xmllint(1)
import <manifest.xml> Import a service manifest into the repository
unselect Navigate to the parent selection, eg: from the
instance back to the service
listsnap List the snapshots for a given service instance
selectsnap Select a snapshot at the instance level
revert [<snapshot>] Revert the service instance to a selected
snapshot
The svcprop command is used to display information about a service from the
repository. There are various options to this command, for example:
svcprop -p <property> <FMRI> Show the values for a given property, eg: $ svcprop
-p start smtp:sendmail
svcprop -s <snapshot> <FMRI> Show the details from a given snapshot
The inetadm command when used with the -m option modifies a property for a given
inetd based service instance. An example of this is:
# inetadm -m svc:/network/ftp:default exec="/usr/sbin/in.ftpd -a -l"
Posted at 11:32PM Jul 31, 2005 by G S Hiregoudar in Solaris | Comments[0]
SMF troubleshooting techniques
Logfiles, Manifests and Methods
===============================
SMF logfiles can be found in the following locations:
/var/svc/log
/etc/svc/volatile
The SMF manifests and methods may be found here:
/var/svc/manifest/*
/lib/svc/method/*
To see the log file location for a given service use:
$ svcs -l <FMRI> | grep logfile
(<FMRI> - Fault Management Resource Identifier. See the svcs(1) manual page for
details of how to specify an FMRI)
Daemons, Configuration and Recovery
===================================
The primary daemons for SMF are svc.startd and svc.configd. At boot time the
kernel will start init, which in turn starts svc.startd and that starts
svc.configd. This latter daemon (svc.configd) will read information from the
repository in /etc/svc/repository.db which is then used by svc.startd to start
the services.
If there is a problem booting the system you should try:
ok boot -m milestone=none
Then try to reach milestone "single-user" by running:
# svcadm milestone svc:/milestone/single-user:default
Observe the services as they start, look at any messages on screen and consult
the error logs for more information. If the repository is corrupt you may need
to restore from a previous saved copy, or reseed it.
The /lib/svc/bin/restore_repository script will guide you through this process.
=================================================
If a service fails to start, you should check:
* The state of the service instance
- If a service is in maintenance mode use:
svcs -xv or svcs -l to see why it failed
inspect the log files for further information
svcadm clear <FMRI> once the fault has been repaired
* The dependencies for the service
- Are they optional or required?
svcs -d shows the dependencies for a service
svcs -l shows whether the dependencies are optional or required
* The error log for the instance
svcs -l <FMRI> | grep logfile tells you where the logfile is
* The properties for the service
svcprop -p start <FMRI> shows the start properties for a service
* Have any changes been made to the repository?
- How many services are affected?
- Have any snapshots been created?
- Can you resort to a previous snapshot?
* The start method for the service
- What type of service is it? (transient, child, contract)
- Look at the start method
- Did the service get killed? Why?
- Check the start method in the manifest and compare it to the repository
entry
- If you need to truss the service starting, you could try something like:
# svcprop -p start/exec network/inetd ! Use to figure out start method
# svccfg -s network/inetd setprop 'start/exec = “truss -f -a -o
/tmp/truss.out
/usr/lib/inet/inetd %m”' ! Use the method obtained from svcprop
# svcadm refresh network/inetd
# svcadm restart network/inetd
Remember to restore the original start method when finished!
======================================================
If there are problems booting the system, you should:
* Capture the error message(s)
* Try to boot to an alternative milestone, eg:
ok boot -m milestone=none
ok boot -s
* If successful and you can login, try to start the next milestone
* Check the error logs and dependencies
* Can you boot the system in verbose mode, eg:
ok boot -m verbose
NOTE: This changes the boot behaviour from parallel to serial
* If the repository is beyond repair, try restoring from an earlier copy
or in the worst case you may need to reseed it.
The utility for this is /lib/svc/bin/restore_repository
Posted at 11:17PM Jul 31, 2005 by G S Hiregoudar in Solaris | Comments[0]
SNMP in Solaris
SNMP in Solaris
Solaris has a rich set of products that support SNMP protocol.
Some of these products are part of Solaris and others can be installed on top of Solaris
* System Management Agent(SMA) * Solstice Enterprise Agent(SEA) * Sun Management Center(SunMC) * Solstice Enterprise Manager(SEM) * Mobile IP agent * Platform specific SNMP agents such as Netra agent, Enchilida, JDMK agent and so on Background SNMP is widely used in enterprise networks to effectively manage systems, network devices, and networks. One of the benefits of SNMP is that solutions can be quickly created to support the increasing numbers of networking components and applications. Within SNMP networks, systems, components, and applications are described as entities. The number of entities that need to be managed is growing rapidly.
SNMP uses a manager and agent architecture. The SNMP manager is a program, also known as a network management station (NMS), that runs on a host on the network. The manager sends requests to one or more SNMP agents running on devices connected to the network. An agent, or daemon, is a program that listens for SNMP requests from the manager.
Agent hierarchy consists of a master agent and subagents. The master agent receives the SNMP-based management requests from the managers. The master agent sends responses to these management requests. Responses are sent after retrieving the appropriate values from respective subagents.
Subagents provide management of different components. Management is based on a Management Information Base (MIB) specifically designed for components or applications. A MIB is a specification containing definitions of management information. Through the use of a MIB: networks and networked systems can be remotely monitored, remotely configured, and remotely controlled.
An agent receives a request and looks up information in the MIB and returns information to the manager. Each object in the MIB represents a piece of data about the managed device, and each object is assigned a unique identifier in the MIB. The manager and agent must have access to the same MIB to be able to communicate about the managed device. The manager uses the MIB to specify identifiers for the information that the agent is to act upon. The agent uses the MIB to look up the identifiers that were passed in the SNMP request from the manager. The agent gets or sets values for the requested data.
The System Management Agent is designed to be a standalone agent. That means the SMA agent can run without having any external NMS to run, but can work with any external NMS using SNMP protocol. The SMA can be accessed by multiple management applications, provided that these management applications communicate with the SMA using SNMP protocols. The SMA can coexist with existing SNMP agents. The SMA replaces some legacy SNMP agents.
The SMA is a new SNMP agent offering from Sun, based on the Net-SNMP open source implementation and is available from solaris 10 onwards. This open source implementation is described at http://www.net-snmp.org/. This open source implementation was formerly known as UCD-SNMP. The System Management Agent is designed to support the latest SNMP standards.
In this Solaris release, the System Management Agent can co-exist with the Solstice Enterprise AgentsTM software. For more information about the Solstice Enterprise Agents software, see the Solstice Enterprise Agents 1.0 User Guide. From an SNMP manager view, the System Management Agent operates in the same way the Solstice Enterprise Agents software. Unlike the Solstice Enterprise Agents software, the System Management Agent supports SNMPv3. The System Management Agent supports more default MIBs than the Solstice Enterprise Agents software. Please refer user and developer guides from http://docs.sun.com
Sun contributions to open source in SNMP world are
IPv6 support
64 bit binaries
Security best practices code enhancements
PKCS support
Documentation enhancements
Large number of bug fixes
SNMP traps
SNMP traps are often used by network devices to report conditions. Trap information will "automatically" go out when the condition for the trap is met.
For instance, if you have multiple network links and you lose one then the "linkDown" trap will go out to inform the Network Management Station (NMS) that your machine has lost a link. All you need to do is define the host names of any NMS that you wish to send traps to. The following piece of code will be generated for TRAP-TYPE variables such as demoEntryString and demoEntryInteger in table column by using mibcodegen(mib compiler). This is fixed as part of 4519879 struct CallbackItem genCallItem[13]={ {(Object *)&column_table[1],STRING,1}, {(Object *)&column_table[2],INTEGER,2}, {&object_table[2],OBJID,-1}, }; int genNumCallItem=3; int genTrapTableMap[11]={ 0,}; int genNumTrapElem = 1; struct TrapHndlCxt genTrapBucket[11] = { {"demotrap1",1,6,1}, }; struct TrapAnyEnterpriseInfo genTrapAnyEnterpriseInfo[11]={ {1, 3, 6, 1, 4, 1, 42, (uint32_t)-1}, }; struct _CallTrapIndx { char name[256]; IndexType *pindex_obj; }; struct _Indx { char name[256]; int index; }; int numIndxElem = 2; struct _Indx Indx[2] = { {"demoEntryString", 0}, {"demoEntryInteger", 0}, }; int SSASetVarIndx(char* name, int index) { int i; if (!name) return (-1); for (i = 0; i < numIndxElem; i++) if (!strcmp(name, Indx[i].name)) { Indx[i].index = index; return (0); } return (-1); } IndexType TrapIndx[3] = { {1,1,&Indx[0].index}, {1,1,&Indx[1].index}, {0,0,NULL}, }; struct _CallTrapIndx CallTrapIndx[1] = { {"demotrap1",&TrapIndx[0]}, }; int SSASendTrap(char* name) { int i; if (!name) return (-1); numCallItem = genNumCallItem; numTrapElem = genNumTrapElem; callItem = genCallItem; trapTableMap = genTrapTableMap; trapBucket = genTrapBucket; trapAnyEnterpriseInfo = genTrapAnyEnterpriseInfo; for (i = 0; i < numTrapElem; i++) if (!strcmp(name, CallTrapIndx[i].name)) return (_SSASendTrap4(name, CallTrapIndx[i].pindex_obj)); return (-1); } In order to make snmdpx handle Traps from subagents during startup, the trap-port for communication between a subagent and snmpdx should be distinguished by using the function SSAGetTrapPort() from the SEA sdk/API. mibiisa mib-II subagent sends traps to snmpdx by send_traps(). send_traps() calls send_a_trap() per manager. This function, send_a_trap(), sends traps to port 162. This is fixed as part of 4889976. /* * This function is used to develop the packet for getting the * master agent trap port. master agent trap port oid is 1.3.6.1.4.1.42.2.15.4.0 * master agent will assign the trap port to mibiisa for processing the * cold start and all generic traps. Master agent will intern forwards the * request to port 162. */ int request_for_trap_port(int mibport) { SNMP_PKT_T *rp; VB_T *vbl; EBUFFER_T ebuff; unsigned char pktp[TBSIZE]; int pktl; int got, p; int indx = 0; char *community = "public"; int commleng; unsigned int pktcom_length; struct sockaddr_in pktsrc; struct sockaddr_in pktdst; INT_32_T request_id; int maport; int count = 0; struct timeval timeout; fd_set readfds, writefds, exceptfds; socklen_t szfrom; timeout.tv_sec = 0; timeout.tv_usec = 0; if (mibport == 161 || (maport = get_port()) == 0) /* maport = master agent port */ /* mibport = mibiisa port */ return (162); else { EBufferInitialize(&ebuff); (void) memset(&pktdst, 0, sizeof (pktdst)); if ((rp = SNMP_Allocate()) == (SNMP_PKT_T *)0) { return (-1); } rp->snmp_version = 0; rp->pdu_type = GET_REQUEST_PDU; commleng = strlen(community); EBufferPreLoad(BFL_IS_STATIC, &(rp->community), community, commleng); rp->pdu.std_pdu.request_id = request_id; rp->pdu.std_pdu.error_status = 0; rp->pdu.std_pdu.error_index = 0; rp->pdu.std_pdu.std_vbl.vbl_count = 1; vbl = (VB_T *) malloc(sizeof (VB_T)); rp->pdu.std_pdu.std_vbl.vblist = vbl; vbl->vb_obj_id = ra_trap_port_oid; if ((vbl = locate_vb(rp, indx)) == (VB_T *)0) return (-1); if (build_object_id(snmp_product_id_count, snmp_product_id, &(vbl->value_u.v_object)) == -1) { Clean_Obj_ID(&(vbl->vb_obj_id)); return (-1); } vbl->vb_data_flags_n_type = VT_EMPTY; if (SNMP_Encode_Packet(rp, &ebuff) == -1) { PRNTF0("Failure encoding startup trap\n"); } pktsrc.sin_family = AF_INET; pktsrc.sin_port = htons(maport); pktsrc.sin_addr.s_addr = inet_addr("127.0.0.1"); szfrom = (socklen_t)sizeof (pktsrc); while (count == 0) { FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptfds); FD_SET(snmp_socket, &readfds); count = select(FD_SETSIZE, &readfds, &writefds, &exceptfds, &timeout); switch (count) { case 0: if ((p = sendto(snmp_socket, (char *)ebuff.start_bp, EBufferUsed(&ebuff), 0, (struct sockaddr *)&pktsrc, szfrom)) < 0) { PERROR("sendto failed"); } (void) gettimeofday(&timeout, (struct timezone *)0); timeout.tv_sec = 0; timeout.tv_usec = 100; continue; case -1: if (errno == EINTR) continue; else PERROR("select failed"); break; default : break; } } if ((got = recvfrom(snmp_socket, (char *)pktp, sizeof (pktp), 0, (struct sockaddr *)&pktsrc, &szfrom)) < 0) { PERROR("Recvfrom failed"); } if ((rp = SNMP_Decode_Packet(pktp, got, (struct sockaddr_in *)&pktsrc, (struct sockaddr_in *)&pktdst)) == (SNMP_PKT_T *)0) { return (-1); } vbl = rp->pdu.std_pdu.std_vbl.vblist; if (vbl->value_u.v_number) return (vbl->value_u.v_number); } return (162); } Debug messages Trap debug messages are shown below. SEA currently supports four traps as outlined in rfc 1215 which are coldStart, linkUp, linkDown, and authenticationFailure. <<debug message from mibiisa mib-II subagent>> Trap packet sent to 127.0.0.1 at Mon May 30 11:22:03 2005 Packet Length=47, Version=0, Community: Length=9, Value=SNMP-trap PDU Type=0x04 Length=31, Enterprise id: OBJ_ID: 1.3.6.1.4.1.42.2.1.1 IP Address: 129.158.226.126 Generic trap=0 (0), specific trap=0 (0), Trap time=153396650 (924A5AA) VBLlen=0, VBcount=0 <<debug message from snmpdx master agent>> << received 42 bytes from localhost.58657 PACKET: ------- 30 28 02 01 00 04 06 70 75 62 6C 69 63 A0 1B 02 01 00 02 01 00 02 01 00 30 10 30 0E 06 0A 2B 06 01 04 01 2A 02 0F 04 00 05 00 PDU: ---- version: 0 community: public type: GET_REQ_MSG (0xa0) request id: 0 error status: noError(0) error index: 0 -------------------------------------------------- name: 1.3.6.1.4.1.42.2.15.4.0 type: NULL (0x5) length: 0 value: ( ) -------------------------------------------------- ## Open session 0 subtree_match() returned 1.3.6.1.4.1.42.2.15 supported by relay-agent address: localhost.58657 n_variables: 1 o_flags: 0x0 i_flags: 0x0 request 0: session: 0 subtree: 1.3.6.1.4.1.42.2.15 visited agents: relay-agent agent: relay-agent (localhost.161) flags: 0x1 state: 0 variables: 1.3.6.1.4.1.42.2.15.4.0 time: 0 sec 0 usec expire: 0 sec 0 usec node_find() returned relayTrapPort with suffix 0 !! get(): processing the variable relayTrapPort PDU: ---- version: 0 community: public type: GET_RSP_MSG (0xa2) request id: 0 error status: noError(0) error index: 0 -------------------------------------------------- name: 1.3.6.1.4.1.42.2.15.4.0 type: INTEGER (0x2) length: 4 value: 58659 -------------------------------------------------- PACKET: ------- 30 2B 02 01 00 04 06 70 75 62 6C 69 63 A2 1E 02 01 00 02 01 00 02 01 00 30 13 30 11 06 0A 2B 06 01 04 01 2A 02 0F 04 00 02 03 00 E5 23 >> sent 45 bytes to localhost.58657 ## Close session 0 SESSIONS: --------- NUMBER OF SESSIONS: 0 << received 49 bytes from localhost.58657 PACKET: ------- 30 2F 02 01 00 04 09 53 4E 4D 50 2D 74 72 61 70 A4 1F 06 09 2B 06 01 04 01 2A 02 01 01 40 04 81 9E E2 7E 02 01 00 02 01 00 43 04 09 24 A5 AA 30 00 PDU: ---- version: 0 community: SNMP-trap type: TRP_MSG (0xa4) enterprise: 1.3.6.1.4.1.42.2.1.1 IP agent addr: goudar generic: coldStart(0) specific: 0 time stamp: 153396650 -------------------------------------------------- SESSIONS: --------- NUMBER OF SESSIONS: 0 Technorati Tag: OpenSolaris Technorati Tag: Solaris
Posted at 08:23AM Jun 14, 2005 by G S Hiregoudar in Solaris | Comments[1]