1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How can I monitor CPU temperature and fan speed?

Discussion in 'System Hardware' started by olav, May 8, 2010.

  1. olav

    olav New Member

    Messages:
    349
    Likes Received:
    0
    I've tried to google for this, but I've only found half answers, and theyre also often very different when it comes to what you should install from ports.

    So I need some help, what is the recommended hardware monitoring software to install? How do I do it? And how do I use it?
     
  2. sverreh

    sverreh New Member

    Messages:
    124
    Likes Received:
    0
    Try mbmon:

    /usr/ports/sysutils/mbmon

    Works nicely for me.
     
  3. paean

    paean New Member

    Messages:
    112
    Likes Received:
    0
    I use conky to monitor temps, fan speed, disc and net usage. There are plenty of nicely prepared scripts available. A few people have shared theirs here on the forums.
     
  4. OH

    OH New Member

    Messages:
    209
    Likes Received:
    0
    Younger intel processors, supported by coretemp(), will have their temperature noted in sysctl
    $ sysctl dev.cpu | grep temp
    Code:
    dev.cpu.0.temperature: 36,0C
    dev.cpu.1.temperature: 37,0C
    
     
  5. User23

    User23 New Member

    Messages:
    347
    Likes Received:
    0
    my kernel config always have the following lines:

    Code:
    # CPU frequency control
    device          [url=http://www.FreeBSD.org/cgi/man.cgi?query=cpufreq&apropos=0&sektion=0&manpath=FreeBSD+8.0-RELEASE&format=html]cpufreq[/URL] 
    device          [url=http://www.FreeBSD.org/cgi/man.cgi?query=amdtemp&apropos=0&sektion=0&manpath=FreeBSD+8.0-RELEASE&format=html]amdtemp[/URL]  # for AMD CPU
    #device         [url=http://www.FreeBSD.org/cgi/man.cgi?query=coretemp&apropos=0&sektion=0&manpath=FreeBSD+8.0-RELEASE&format=html]coretemp[/URL]  # for Intel CPU
    
     
  6. sk8harddiefast

    sk8harddiefast Member

    Messages:
    2,008
    Likes Received:
    3
    set this line on /boot/loader.conf
    Code:
    coretemp_load="YES"
    reboot and sysctl dev.cpu | grep temp show you something like this:
    Code:
    dev.cpu.0.temperature: 59.0C
    dev.cpu.1.temperature: 57.0C
    dev.cpu.2.temperature: 55.0C
    dev.cpu.3.temperature: 56.0C
    Now i am trying to exec somehow sysctl dev.cpu | grep temp on conky
    there is also xmbmon where is the graphical mbmon if you like it :)
     
  7. DutchDaemon

    DutchDaemon Administrator Staff Member Administrator Moderator

    Messages:
    10,622
    Likes Received:
    2
    Don't grep sysctl output, just run something like sysctl -n dev.cpu.0.temperature.
     
  8. sk8harddiefast

    sk8harddiefast Member

    Messages:
    2,008
    Likes Received:
    3
    DutchDaemon solutions sounds much better :)
    There Is difference of grep and -n on sysctl? (except the output of "sysctl -n dev.cpu.0.temperature" shows the temp of the first core and "sysctl dev.cpu | grep" shows temp of all cores)
     
  9. olav

    olav New Member

    Messages:
    349
    Likes Received:
    0
    Coretemp works great! Ive tried mbmon too, but it reports a different temperature? And the fan speed, is it rotations per hour?
     
  10. Beastie

    Beastie Member

    Messages:
    1,916
    Likes Received:
    1
    You're on FreeBSD, and the documentation is at your fingertips!

    -n shows the variable without the names. You get the difference you mentioned because DutchDaemon specified core 0. You could just as well use % sysctl -n dev.cpu or better, call % sysctl -n dev.cpu.n.temperature four times one for each core. Like this:
    Code:
    #!/bin/sh
    
    cores=0
    
    until [ $cores -eq 4 ]
    do
    	echo Core \#$cores: `sysctl -n dev.cpu.$cores.temperature`
    	cores=`expr $cores + 1`
    done
    
     
  11. sk8harddiefast

    sk8harddiefast Member

    Messages:
    2,008
    Likes Received:
    3
    Code:
    #!/bin/sh
    
    cores=0
    
    until [ $cores -eq 4 ]
    do
    	echo Core \#$cores: `sysctl -n dev.cpu.$cores.temperature`
    	cores=`expr $cores + 1`
    done
    if i exec this script on conky i will get core temp?
     
  12. Beastie

    Beastie Member

    Messages:
    1,916
    Likes Received:
    1
    I guess so...
    Code:
    ${color #ff0000}${execi 30 coretemp.sh}
    
     
  13. sk8harddiefast

    sk8harddiefast Member

    Messages:
    2,008
    Likes Received:
    3
    worked find but i have a little problem.Temp shows vertical but i have horizontal conky.Any ideas?
     
  14. Beastie

    Beastie Member

    Messages:
    1,916
    Likes Received:
    1
    Code:
    #!/bin/sh
    echo `sysctl -n dev.cpu.0.temperature`/`sysctl -n dev.cpu.1.temperature`/`sysctl -n dev.cpu.2.temperature`/`sysctl -n dev.cpu.3.temperature`
    
     
  15. sk8harddiefast

    sk8harddiefast Member

    Messages:
    2,008
    Likes Received:
    3
    ok!worked :)
    Thanks!!!Now my conky is more complete :)
     
  16. klabacita

    klabacita New Member

    Messages:
    140
    Likes Received:
    0
    Hi.

    Guys, where I can see all the CPU's that coretemp support or how do I know?
    Xeon is on them right?

    Thanks!!!
     
  17. User23

    User23 New Member

    Messages:
    347
    Likes Received:
    0
    from the coretemp man page:

    DESCRIPTION
    The coretemp driver provides support for the on-die digital thermal sen-
    sor present in Intel Core and newer CPUs

    ---

    Code:
    sysctl -a | grep temp
    and you will get for example:

    Code:
    net.inet6.ip6.use_tempaddr: 0
    net.inet6.ip6.temppltime: 86400
    net.inet6.ip6.tempvltime: 604800
    net.inet6.ip6.prefer_tempaddr: 0
    dev.cpu.0.temperature: 33.0C
    dev.cpu.1.temperature: 32.0C
    dev.cpu.2.temperature: 28.0C
    dev.cpu.3.temperature: 32.0C
    dev.coretemp.0.%desc: CPU On-Die Thermal Sensors
    dev.coretemp.0.%driver: coretemp
    dev.coretemp.0.%parent: cpu0
    dev.coretemp.1.%desc: CPU On-Die Thermal Sensors
    dev.coretemp.1.%driver: coretemp
    dev.coretemp.1.%parent: cpu1
    dev.coretemp.2.%desc: CPU On-Die Thermal Sensors
    dev.coretemp.2.%driver: coretemp
    dev.coretemp.2.%parent: cpu2
    dev.coretemp.3.%desc: CPU On-Die Thermal Sensors
    dev.coretemp.3.%driver: coretemp
    dev.coretemp.3.%parent: cpu3
    now you know the variable you are able to ask with sysctl directly for it, without wasting cpu time while asking for all of the variables :)

    example:

    Code:
    sysctl dev.cpu | grep temp
    for
    Code:
    dev.cpu.0.temperature: 32.0C
    dev.cpu.1.temperature: 31.0C
    dev.cpu.2.temperature: 28.0C
    dev.cpu.3.temperature: 31.0C
    or directly:

    Code:
    sysctl dev.cpu.0.temperature
     
  18. klabacita

    klabacita New Member

    Messages:
    140
    Likes Received:
    0
    This is just for reference, I see that my current Xeon is able to give this info.

    Thanks User23.
     
  19. ddc

    ddc New Member

    Messages:
    3
    Likes Received:
    0