Skip to content

shamazmazum/freebsd-sysctl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

freebsd-sysctl

Build Status

freebsd-sysctl is a wrapper around sysctl system call for FreeBSD. It can be used, for example, in system monitors in StumpWM's mode line for tracking CPU temperature. Currently it can get/set sysctl variables, automatically detecting their formats, list sysctl nodes, etc.

Examples

Here is the documentation in a form of examples.

;; Read a sysctl value
(freebsd-sysctl:sysctl-by-name "kern.hz")
;;  >> 1000
;;  >> NIL

;; You can also access values via MIBs (Management Information Base)
(freebsd-sysctl:sysctl (freebsd-sysctl:sysctl-name=>mib "kern.hz"))
;;  >> 1000
;;  >> NIL

;; It can detect temperature format
(freebsd-sysctl:sysctl-by-name "dev.cpu.0.temperature")
;;  >> 46.149994
;;  >> NIL

;; It also understands strings
(freebsd-sysctl:sysctl-by-name "dev.pcm.3.output")
;;  >> "Line-Out"
;;  >> NIL

;; You can set a new value to sysctl
(freebsd-sysctl:sysctl-by-name "dev.pcm.3.output" "Headphones")
;;  >> "Line-Out"
;;  >> "Headphones"

;; You can list a sysctl node
(freebsd-sysctl:list-sysctls "dev.pcm.3.play")
;;  >> ("dev.pcm.3.play.vchans" "dev.pcm.3.play.vchanmode" "dev.pcm.3.play.vchanrate"
;;      "dev.pcm.3.play.vchanformat")
~~~~~~~~~~~~~~~

TODO
----
Make it possible to get all sysctls as with `sysctl -a`.

About

FreeBSD's sysctl interface to common lisp

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published