Finding the right SMTP server

Hi there,
I'm trying to send a simple email from a servlet but when I do so I get an exception because SMTPTransport can't connect to localhost on port 25. I'm just using the reference implementation server that comes with J2SDKEE1.2.1 (on Windows XP) and have downloaded the relevant jar files for JavaMail and Jaf, included them in the classpath, etc.
Should I be trying to direct it to a different SMTP server or port, and if so how do I find out where they are?
Any help would be greatly appreciated!
Rory.

You have to know the address of the mail excange server of the person
whom u are sending email,it can be found doing dns query for the host.
For example if u want to send email to : [email protected] then u have
to find the mail exchange server address of AOL.U can find this by
DNS tools,you can find one at http://www.sourceforge.net .
when u get back the name of MX(mail exchange Server) from dns look up
then u have to this.
props.put("mail.smtp.host", smtpServer);
where the smtpServer is the mail exchange server name for the Host.

Similar Messages

  • Finding the right delimiter

    I have developed a cross-platform LabVIEW based application. It will run on Mac OSX, Linux and Windows. It needs to reliably detect the operating system it is running on to use the right delimiters for pathnames (I generate file names / folders based on other front panel input).
    I have been using a kludge of sorts to do this. I use a VI server reference and use the OS Name property node, wire it into a search / replace string VI and count the number of times a substring "Windows" is replaced. If the number of replacements is greater than 0, I know it is Windows. Else, I test for Linux. Do the same thing. Then if it is neither Windows nor Linux, I assume it is Mac OSX.
    This kludge which worked for the VIs running on Mac OSX and Windows, does not seem to work for the application compiled on Windows LabVIEW PDS (the absence of a gcc style cross-compiler for LabVIEW is a sort of a raw subject for me right now since NI forces developers to pick an OS by creating a needless barrier for cross-platform compilation, but we will not go into that). There are no other points in my code which detect the right delimiter to use (":" for Mac HFS, "/" for Linux filesystems and "\" for Windows FAT32 and NTFS).
    I imagine that there are folks here who have tried to something of the sort. Is there a Detect OS and Find the right Delimiter.vi that someone may have and want to share ?
    Solved!
    Go to Solution.

    You can use the Application.TargetOS property to determine what platform you are running on.
    You can also use a vi in vi.lib\Utility\libraryn.llb called 'Is Name Multiplatform.vi' to validate your file name.
    The Application.TargetOS property is used in this vi if you want an example.
    As mentioned, always use Build Path; it will be much safer than concatenating strings...
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • Where can I find the right LIB_DBSL.SAR??

    hi all,
        I want to connect to the other DBMS.The detail is: my BI application server DBMS is oracle, it  runs on linux,64 bit,and the target DBMS is MSS 2000.
        The question is where can I  find the right LIB_DBSL.SAR,could you give me a link address?
        Thx..

    Hi,
    You need to log in to  service marketplacewith S userID& password. After logging into SMP, we need to find the relevant Database to find the Shared libraries that is LIB_DBSL.SAR file & then need to unarchive in order to load the DB dependent shared libraries.
    Regards
    Venkat

  • Finding the right computer

    I'm not that knowledgable on laptops and I'm looking to purchase one where do I start?

    Credit goes to an Author by the name of Paul Tansey on BestBuy.com  for creating this buying guide:
     Laptop Computer Buying Guide
    By Paul Tansey  
    There's no way around it: you need a computer at home. Computers make it so easy to stay in touch, stay organized, entertained and informed, it's a wonder we ever did without them.
    With laptop technology advancing in leaps and bounds, there's no reason you can't take this power and convenience with you wherever you go, considering you can stay connected wirelessly just about anywhere these days. And most laptops can do anything a desktop can do, without the bulky tower and without forcing you to stay indoors. So just because you're working doesn't mean you can't work in the park!
    There are about as many different kinds of laptops out there as there are ways to use them, so let's look at some key points that will help you decide which one is right for you.
    If you want the basics...
    Choose a model that has the features you need to everyday computing. Not for making crazy rocket science calculations or memory eating applications, but to do the things that make life easier, like e-mail, Web browsing and word processing.
    Most models come with wireless capability, so you can grab a seat in any wireless Internet hotspot and surf to your heart's content.
    If you travel a lot...
    Many newer laptops are thinner and lighter than ever but still deliver heavyweight performance, packing all of the processing power, hard drive space and versatility you want into a thin frame that weighs less than 4.5 pounds. You'll pay a little more for the thin and light, but if you have to carry your laptop around with you wherever you go, you'll very quickly appreciate leaving the extra bulk behind.
    If you're big on home entertainment, photos and music...
    These top-end models feature big widescreen displays enhanced for crystal-clear, smooth video playback. The video cards, processors and operating systems are also enhanced for high-performance video and audio, with Media Center models featuring personal video recorder (PVR) capability, a built-in TV tuner, surround sound and multiple digital and analog video inputs.
    PVRs will change how you watch TV. Pause and replay live TV, then skip back to the live feed when you're ready. You can also program your laptop to automatically record your favorite shows.
    For your always-growing collection of images and music files, there are models that feature faster processors, more RAM and larger hard drives. They are also enhanced for displaying photos, and you have more options for getting your media into the computer, including additional USB slots and built-in memory card readers to swap images straight from your digital camera or other device.
    If you're all business...
    Professional Series laptops meet the demands your business requires whether you're working from home, in the office or on the road.
    Since your laptop is your business, look for enhanced security features like a fingerprint reader, which allows only authenticated users to access it, and an encrypting file system to allow for file and folder encryption at the user level. Some include motion-sensing hard drive protection that safeguard the laptop's hard drive against damage from a sudden movement or drop - important to consider when going from meeting to meeting.
    If size matters...
    Laptops come in all shapes, sizes and weights. Many are now an inch thick or less, with absolutely every millimeter of internal space used efficiently. These thin laptops don't lose a step compared to their beefier competition, with just as much processing power and a screen size and keyboard that won't leave you feeling shortchanged.
    As laptops get a little larger, the size of the screen also climbs. You can find high-performance Thin Film Transistor (TFT) LCD screen sizes ranging from 4.5" to 17" or more, most set up as widescreens.
    If you prefer wireless freedom...
    Nearly all laptops are capable of working wirelessly, with wireless cards and processors enhanced to perform when you're connected at a hotspot. Many laptops now include Bluetooth wireless for easy, safe, secure linking with a wide range of other devices, from handhelds to cell phones to wireless headphones.
    Instead of confining yourself to your office or den, or inflicting a tangle of wires and computer components on your décor, you can set your family up with a network of wireless laptops. Everyone gets the access they need, when and where they want it. Plus, if you need your computer for work, you can take everything with you and not worry about leaving a file behind or denying anyone their computer time.
    Multiple users can go online at once, and all of the same access protection can be installed to keep your kids away from online dangers. You can all use one central wireless printer and scanner for total convenience.
    If performance is key...
    Processing power can separate the handy from the incredible, so if performance is key, look for more processing power. Most processors will fall within the range of 1.0GHz to 3.0GHz, but different types of processors excel in different ways.
    The Intel lineup starts with the Celeron® M, while the Pentium® Dual Core is peppier and more powerful. The top-of-the-line Centrino® chipsets feature Core™, Core™ Duo and Core™2 Duo processors with built-in wireless capabilities, improved power-saving capabilities and enhanced performance.
    AMD also has a good range of processors. The AMD Turion™ 64 X2 and Turion™ 64 mobile technology is similar to Centrino® and adds wireless performance to their high-end processors with some supporting Bluetooth technology.
    RAM is also an important performance factor and serves as the real-time memory that makes your applications run faster and makes it possible to work with huge files. RAM starts at about 512MB, but most models can be upgraded with extra memory. You can find some that can be upgraded all the way to 4.0GB, which comes in handy for demanding multimedia applications.
    Many of the higher-end models will also include a generous amount of RAM built into the video card for smooth performance, especially for today's advanced 3D games.
    Drives
    Hard drive sizes vary considerably, from about 60GB (more than enough for basic computing needs) all the way up to 240GB, ideal for multimedia, home entertainment and games. Faster hard drives (measured in RPM) are better for quick access to data and for smooth video and game operation.
    Optical drives - The DVD/CD drive is at least capable of reading DVD-ROMs and burning CDs, but more and more can now work with rewritable DVD±R/RW and even double-sided or double-layered DVDs. If you need better performance, look for write speeds in the range of 24x for CD and 8x for DVD.
    Increasing the cool factor, optical drives on some HP computers are outfitted with a technology called LightScribe, which can burn a professional-looking label right onto your disc.
    The softer side
    The operating systems you can choose from will also impact performance, and will often include software to work with photos, multimedia or even TV.
    Windows Vista features Windows Media Center, a multimedia powerhouse that lets you watch your favorite shows, enjoy prized photos and manage your music. In addition, Windows Vista has numerous enhanced security features, new interface elements and increased mobility for working with other users or devices.
    The Apple® Mac OS X 10.4 Tiger also delivers great multimedia and networking performance and comes bundled with photo, music and moviemaking software.
    Staying power
    Battery life is also a consideration. Many manufacturers have been working to improve the efficiency of their systems to extend the amount of work you can accomplish per charge. This will come in handy on long trips or when you have to finish a project but can't find anywhere to plug in, like when you're on a park bench or a coffee house patio.
    Accessories for protection and convenience
    First and foremost, a laptop case will not only make it easier to carry around your computer and its related accessories, but it will also protect your investment. Laptop cases range in size, with some designed for style and others for capacity, and many for both.
    A small laptop mouse will give you a welcome break from your current pointing device, making it easier to navigate your screen. They come in either wired or wireless versions. An extra power adapter - one in the bag and one for the office - and back-up battery are also a good idea, so you never get caught without power.
    A flash drive that plugs directly into a USB port is an inexpensive and efficient way to transfer files. Pop one into your laptop case.
    With a better understanding of what separates a good laptop from a great one, it's easy to find the right one for you.
    Shop our current selection of laptops or check out our Laptop Finder. 
    *******DISCLAIMER********
    I am not an employee of BBY in any shape or form. All information presented in my replies or postings is my own opinion. It is up to you , the end user to determine the ultimate validity of any information presented on these forums.

  • How To Turn On the IIS SMTP Server?

    I have the IIS SMTP server installed in my PC. While testing to send e-mails using the JavaMail, I can see that messages do not reach the server.
    I have never used the IIS SMTP server before. I think the problem is that the server is not running (I could be wrong). How do I turn on the IIS SMTP server?

    My IIS SMTP is running because
    1. I typed http://xp-jenc-c/ in the browser and I am connected to the Windows XP Professional (http://xp-jenc-c/localstart.asp) and it says that 'Your web service is now running.'
    2. On my desktop screen, I click on the IIS. And then expand the XP-JENC-C (local computer) node. Right-click on the Default SMTP Virtual Server. I can see 'Start' is grayed out. Only Stop and Pause are the available choices.
    However, messages cannot reach the server. It is hanging after I submit the mail message. Here is the code of the msgsend. java:
    import java.io.*;
    import java.net.InetAddress;
    import java.util.Properties;
    import java.util.Date;
    import javax.mail.*;
    import javax.mail.internet.*;
    * Demo app that shows how to construct and send an RFC822
    * (singlepart) message.
    * XXX - allow more than one recipient on the command line
    * @author Max Spivak
    * @author Bill Shannon
    public class msgsend {
        public static void main(String[] argv) {
         new msgsend(argv);
        public msgsend(String[] argv) {
         String  to, subject = null, from = null,
              cc = null, bcc = null, url = null;
         String mailhost = null;
         String mailer = "msgsend";
         String protocol = null, host = null, user = null, password = null;
         String record = null;     // name of folder in which to record mail
         boolean debug = false;
         BufferedReader in =
                   new BufferedReader(new InputStreamReader(System.in));
         int optind;
         for (optind = 0; optind < argv.length; optind++) {
             if (argv[optind].equals("-T")) {
              protocol = argv[++optind];
             } else if (argv[optind].equals("-H")) {
              host = argv[++optind];
             } else if (argv[optind].equals("-U")) {
              user = argv[++optind];
             } else if (argv[optind].equals("-P")) {
              password = argv[++optind];
             } else if (argv[optind].equals("-M")) {
              mailhost = argv[++optind];
             } else if (argv[optind].equals("-f")) {
              record = argv[++optind];
             } else if (argv[optind].equals("-s")) {
              subject = argv[++optind];
             } else if (argv[optind].equals("-o")) { // originator
              from = argv[++optind];
             } else if (argv[optind].equals("-c")) {
              cc = argv[++optind];
             } else if (argv[optind].equals("-b")) {
              bcc = argv[++optind];
             } else if (argv[optind].equals("-L")) {
              url = argv[++optind];
             } else if (argv[optind].equals("-d")) {
              debug = true;
             } else if (argv[optind].equals("--")) {
              optind++;
              break;
             } else if (argv[optind].startsWith("-")) {
              System.out.println(
    "Usage: msgsend [[-L store-url] | [-T prot] [-H host] [-U user] [-P passwd]]");
              System.out.println(
    "\t[-s subject] [-o from-address] [-c cc-addresses] [-b bcc-addresses]");
              System.out.println(
    "\t[-f record-mailbox] [-M transport-host] [-d] [address]");
              System.exit(1);
             } else {
              break;
         try {
             if (optind < argv.length) {
              // XXX - concatenate all remaining arguments
              to = argv[optind];
              System.out.println("To: " + to);
             } else {
              System.out.print("To: ");
              System.out.flush();
              to = in.readLine();
             if (subject == null) {
              System.out.print("Subject: ");
              System.out.flush();
              subject = in.readLine();
             } else {
              System.out.println("Subject: " + subject);
             Properties props = System.getProperties();
             // XXX - could use Session.getTransport() and Transport.connect()
             // XXX - assume we're using SMTP
             if (mailhost != null)
              props.put("mail.smtp.host", mailhost);
             // Get a Session object
             Session session = Session.getInstance(props, null);
             if (debug)
              session.setDebug(true);
             // construct the message
             Message msg = new MimeMessage(session);
             if (from != null)
              msg.setFrom(new InternetAddress(from));
             else
              msg.setFrom();
             msg.setRecipients(Message.RecipientType.TO,
                             InternetAddress.parse(to, false));
             if (cc != null)
              msg.setRecipients(Message.RecipientType.CC,
                             InternetAddress.parse(cc, false));
             if (bcc != null)
              msg.setRecipients(Message.RecipientType.BCC,
                             InternetAddress.parse(bcc, false));
             msg.setSubject(subject);
             collect(in, msg);
             msg.setHeader("X-Mailer", mailer);
             msg.setSentDate(new Date());
             // send the thing off
             Transport.send(msg);
             System.out.println("\nMail was sent successfully.");
             // Keep a copy, if requested.
             if (record != null) {
              // Get a Store object
              Store store = null;
              if (url != null) {
                  URLName urln = new URLName(url);
                  store = session.getStore(urln);
                  store.connect();
              } else {
                  if (protocol != null)          
                   store = session.getStore(protocol);
                  else
                   store = session.getStore();
                  // Connect
                  if (host != null || user != null || password != null)
                   store.connect(host, user, password);
                  else
                   store.connect();
              // Get record Folder.  Create if it does not exist.
              Folder folder = store.getFolder(record);
              if (folder == null) {
                  System.err.println("Can't get record folder.");
                  System.exit(1);
              if (!folder.exists())
                  folder.create(Folder.HOLDS_MESSAGES);
              Message[] msgs = new Message[1];
              msgs[0] = msg;
              folder.appendMessages(msgs);
              System.out.println("Mail was recorded successfully.");
         } catch (Exception e) {
             e.printStackTrace();
        public void collect(BufferedReader in, Message msg)
                             throws MessagingException, IOException {
         String line;
         StringBuffer sb = new StringBuffer();
         while ((line = in.readLine()) != null) {
             sb.append(line);
             sb.append("\n");
         // If the desired charset is known, you can use
         // setText(text, charset)
         msg.setText(sb.toString());

  • I did not find the right place for my question but Is Apple's products are shipped to the Gulf States by a company Aramex ?

    I did not find the right place for my question but Is Apple's products are shipped to the Gulf States by  Aramex ?

    An absolute URL will be a complete URL, it traces from the abosulte root of a file's location on a server...
    http://www.thesite.com/assets/images/Front_Page_Rotating_Banner/banners.xml
    A relative URL is anything short of including the http://domain..., and is read relative to wherever the file using it exists
    assets/images/Front_Page_Rotating_Banner/banners.xml
    In Flash files though, relative links need to be specified relative to the HTML page that embeds the swf.  So if the swf is in a different folder than the html page that embeds it, the swf's targeting must be adjusted as if it were actually in the html file's folder.

  • I have a iphone 4s with ios 8.3 and I used to be able to sync only a week or two of emails from outlook email.  Now it won't let me do that and it syncs all my inbox.  How can I change it back to sync less.  I can't find the right place.

    I have a iphone 4s with ios 8.3 and I used to be able to sync only a week or two of emails from outlook email.  Now it won't let me do that and it syncs all my inbox.  How can I change it back to sync less.  I can't find the right place.

    I understand, as that was the place I would change it before 8.3 but now that option of Mail Days to Sync is not available?  Any idea why that would be?

  • I have multiple accounts using the same smtp server, I can only reply with one as the settings wont allow me 2 servers

    I have tried to set my email to reply from my iphone 5 both of which use the same SMTP server. I can't change the settings on the others as it will only allow one mail account. Can I add multiple  with the same smtp?

    I Am not using gmail I use seperate company for my mails both use the same smtp server. The problem is when I set my first account it them uses these details and passwords when I create the second account saying that the smtp server is already in use by the primary account. I therefor can't set the password.

  • How can I get a search bar added to my email archives screen to make it easier to search for the right archives folder, Samsung has one so I was surprised to see that I have to scroll up and down to find the right folder?

    How can I get a search bar added to my email archives screen to make it easier to search for the right archives folder, Samsung has one so I was surprised to see that I have to scroll up and down to find the right folder?

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes
    You can modify the pref <b>keyword.URL</b> on the <b>about:config</b> page to use Google's "I'm Feeling Lucky" or Google's "Browse By Name".
    * Google "I'm Feeling Lucky": http://www.google.com/search?btnI=I%27m+Feeling+Lucky&ie=UTF-8&oe=UTF-8&q=
    * Google "Browse by Name": http://www.google.com/search?ie=UTF-8&sourceid=navclient&gfns=1&q=
    * http://kb.mozillazine.org/keyword.URL
    * http://kb.mozillazine.org/Location_Bar_search

  • HT1443 I need to upgrade from 10.5.8 to 6.0 or better to use a new HP wireless printer.  How do I find the right item to download?

    I need to upgrade from 10.5.8 to 6.0 or better to use a new HP wireless printer.  How do I find the right item to download?

    There is no download; you need to buy a Mac OS X 10.6 DVD.
    (83218)

  • Several Mail Accounts with the same smtp server

    Let’s assume, you have several accounts but however, you need to login to the same smtp server with different credentials (once with [email protected] and once with [email protected] – authentication on smtp servers is used to prevent spam): This works smooth on every mailbin on your apple/pc.
    Try to import your settings with itunes to iphone and everything crashes. Iphone is unable to distinguish accounts on imported smtp servers – you can’t set individual passwords this way.
    Work around: Create the accounts manually on iphone.

    Ameya,
    Have a look at your existing DAD configuration, it should be fairly obvious what you need to do to point at another instance.

  • Finding The Right App

    im having trouble finding the right app for my ipad. i will spend money and everything, but there are just no good apps out there. the type of app i want is a creation app, sort of like google sketchup, or even better, something like cinema 4d. ive never seen any app come even close to anything like that. i just like making and designing things. i play the game "Soundrop" alot because you just simply create lines into creative little structures and paths for the balls to bounce. if they ever came out for a line rider for the ipad i would probably pay $50+ just for that one app which already exists on the iphone but sadly not on the ipad...does someone have any suggestions for any apps that you think i would like?

    if they ever came out for a line rider for the ipad i would probably pay $50+ just for that one app which already exists on the iphone but sadly not on the ipad
    Sure it is. $2.99
    -> Line Rider HD

  • HT4539 I have 2 year old I-phone 4 that has never been updated. I need to download an update from my computer but can not find the right place on the I-Tunes page. Do you know where is the right place to update a phone that does not have an "update" butto

    My (old, never updated) I-phone has no "update" button in Settings and I would like to update it. I can not find the right place on I-Tunes to download the updates. Do you know where to look?

    Update your iPhone, iPad, or iPod touch - Support - Apple

  • Unable to find the workbook on server while accessing woekbook

    I am opening in query in Bex analyzer
    After getting the result , I am saving the file as workbook in favourites folder
    It is not giving any error. When I try to open the workbook It shows me the name in the favourites folder, but gives error "Unable to find the workbook on server"
    If I close the Bex analyzer and open again, its now showing the file in favourites folder meaning file was not saved on the server. I tried with sap_all authorization
    Please help

    Hi,
    I got the same problem as yours. But if "sap-all" given, it works. I do not want to give this authorization to all users, so would you pls tell me your final solution?
    Thanks a lot.
    BR.
    Angela

  • How to find the right kstat info & interpret it ?

    Having found out how to read the kstat structures I am
    still struggling with finding the right information which
    makes sense!
    I am interested in the following statistics:
    0. Swap Space - similar to that reported by swap
    1. Scan rate similar to that reported by vmstat
    2. Handspread page (see Adrian Cockcrofts' performance monitoring articles)
    3. Disk Space Usage - similar to df -k
    4. Process memory usage -- ps
    5. System Error Messages -- this may not be possible to read at all
    from kstat. Probably here I will have to make do with reading /var/adm/messages
    6. Disk Errors -- similar to iostat -E (Solaris 2.6 onwards)
    7. Ethernet stats -- like netstat -I le0
    I found the following article on SunSolve Online: FAQ 1230 'Three Virtual Memory Performance Monitors' which directs me to some of the kstat cell
    types.
    I started with swap space. The above article plus a few other pointers seemed to indicate the the
    correct kstat struct and field to use here was vminfo.swap_avail
    When I compared the figures dumped from this structure with those reported by vmstat & swap they
    did not compare! eg.
    kstat: vminfo.swap_avail 321393372929
    kstat: vminfo.swap_free 33339822544
    vmstat unix tool:
    swap avail (KB) 19932
    Furthermore sysinfo.h indicates that vminfo.swap_avail is expressed in pages.
    1 page = 4.096 KB, so the kstat figures should be multiplied by 4 which makes
    the comparison even worse. Whilst I don't expect the figures to be
    an exact match -- I was hoping they would be in the same ball-park,
    Next I tried page in/page out rate
    Here I compared:
    kstat: cpu_vminfo.pgpgin 473224
    kstat: cpu_vminfo.pgpgout 14554
    vmstat unix tool:
    pi (page in) 4
    po (page out) 0
    These figures sort of match up, if you take the most sig digit in
    vminfo.
    I was wondering if anyone has a definitive list on what are the best
    kstat fields to use -- and if any wierd and wonderful calculations must
    be performed on any of them to get figures close to that supplied by
    the familiar unix tools.

    Hi!
    I wrote a quick program to read the vminfo stats and like you saw completely crazy figures. I looked further into this and found that every second, the system clock routine adds the freemem, swap and so on to a cumulative total.
    To put it another way, the figure you see for free memory is the sum total of the value of freemem sampled every second since your system booted.
    Thus, to get the average freemem in pages since boot, you need to read the value of freemem and divide by the number of seconds since boot.
    You can derive the number of seconds in two ways from the kstats:
    (1) read lbolt (incremented every 100th sec) and divide by 100 (hz)
    or (2) read sysinfo.updates (which is incremented every time the kstats are updated).
    I have attached a sample program that demonstrates both of these and reports average freemem since boot in K (like vmstat).
    Similarly, to get a 5 second average, take two readings of freemem and sysinfo.updates five seconds apart , then calculate
    (freemem2-freemem1)/(updates2-updates1)
    It seems most, if not all, of the system counters are cumulative in this fashion.
    Hope that helps.
    Ralph
    SUN Developer Technical Support
    <pre>
    #include <stdio.h>
    #include <stdlib.h>
    #include <unistd.h>
    #include <kstat.h>
    #include <sys/types.h>
    #include <sys/time.h>
    #include <sys/sysinfo.h>
    #include <stdio.h>
    main()
    kstat_ctl_t *kc;
    kstat_t *vminfo_ksp;
    kstat_t *system_misc_ksp;
    kstat_t *sysinfo_ksp;
    kstat_named_t *lbolt_knp;
    vminfo_t vminfo;
    sysinfo_t sysinfo;
    int hz;
    int ltime;
    ulong_t updates;
    if ((kc = kstat_open()) == NULL)
    perror("kstat_open failed"); exit(1);
    /* get lbolt and divide by hz to get secs since boot */
    system_misc_ksp = kstat_lookup(kc, "unix", 0, "system_misc");
    kstat_read(kc, system_misc_ksp, NULL);
    lbolt_knp = kstat_data_lookup(system_misc_ksp, "lbolt");
    hz = sysconf(_SC_CLK_TCK);
    ltime = lbolt_knp->value.l/hz;
    /* get number of statistic updates so far (=secs since boot) */
    sysinfo_ksp = kstat_lookup(kc, "unix", 0, "sysinfo");
    kstat_read(kc, sysinfo_ksp, &sysinfo);
    updates=sysinfo.updates;
    printf("lbolt time %d\n",ltime);
    printf("updates %d\n",updates);
    /* get vminfo */
    vminfo_ksp = kstat_lookup(kc, "unix", -1, "vminfo");
    kstat_read(kc, vminfo_ksp, &vminfo);
    printf("freemem %lld\n",(vminfo.freemem*4)/updates);
    printf("freemem %lld\n",(vminfo.freemem*4)/ltime);
    </pre>

Maybe you are looking for

  • How do i use my HP 4500 as USB and wireless?

    Hi I have my printer set up as wireless. This is fine for mobile devices like my tablets but only 50% of the time it works from my Windows 8.1 PC. How do i change so it works for USB on PC and wireless for tablet etc? I tried to resinstall set up cd 

  • HP Laserjet Pro 400 MFP M425dn for Windows XP Profesional SP 3 not installed

    At the beginning of the installation appears error message "HP CSI Shell - found an error" but the installation continues, but after a few seconds the following message appears "HP installer - found error". The installation continues, and soon appear

  • Can't access store. So go back to v4.? but even that ain't easy.

    Given I am still unable to find the needle in the haystack that is the problem that prevents me from accessing the music store under version 6, I tried to re-install ver 4, but the library file (.itl) has been altered by the upgrade and itunes throws

  • Reveresing black and white still Photoshop image in FCP?

    is it possible to reverse the black and white of a still photoshop image within FCP? then remove the background apart from the letters? need to get a black and white company logo into FCP for use in the credits of this programme - due to a graphic de

  • Create submit button through extension

    hi guys i have a requirement to create a new button on oaf page.i am extending controller and writing below code.but there is no button displaying on page.plz help me.am using jdev 9i and oracle ebs 11i.    OASubmitButtonBean oasb= (OASubmitButtonBea