[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Monitoring character device on FreeBSD

From: Peter Klett
Subject: Monitoring character device on FreeBSD
Date: Wed, 20 Jul 2005 19:46:57 +0200
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

Hi list,

this is my first post, so if I'm doing something wrong, please correct me.
I'm having troubles to get monit (last version, compiled from source, fetched from homepage) working on my FreeBSB 5.4 box
First I encounter sporadically errors when checking for https-websites:

monit: new_ssl_connection(): Openssl engine error: error:140A90A1:SSL routines:func(169):reason(161) monit: new_ssl_connection(): Cannot initialize SSL server certificate handler!

After some digging I found out that this means "library has no ciphers" in function SSL_CTX_new

Anyway what me really troubles is, that I can't monitor character devices. I'm using some (g)vinum disks to enforce some kind of quota.
My config looks like this:

check device athos_disk with path /dev/gvinum/vhost_small
    start program  = "/sbin/mount /data/jails/vhost_small"
    stop program  = "/sbin/umount /data/jails/vhost_small"
    if failed permission 640 then unmonitor
    if failed uid root then unmonitor
    if failed gid operator then unmonitor
    if space usage > 80% then alert
    if space usage > 99% then stop
    if inode usage > 80% then alert
    if inode usage > 99% then stop
    group athos

/dev/gvinum/vhost_small looks like this:

# ls -la /dev/gvinum/vhost_small
crw-r-----  1 root  operator    4,  60 Jul  7 19:50 /dev/gvinum/vhost_small

Even more strange for me is, that also my "real" partitions are also character devices, e.g.:

# ls -la /dev/da0s1a
crw-r-----  1 root  operator    4,  14 Jul  7 19:50 /dev/da0s1a

which makes me wonder what do other people with monit and freebsd ?

So I kept getting an error when running monit:

monit: Not file, directory or block special device: '/dev/gvinum/vhost_small'
'athos_disk' unable to read device /dev/gvinum/vhost_small state

After some looking into the source I finally found this piece in device/device_common.c line 98

} else if(S_ISBLK(buf.st_mode)) {

which i modified to read

} else if(S_ISBLK(buf.st_mode) || S_ISCHR(buf.st_mode)) {

It compiles and links well, but after starting monit -I -c i got strange results

'athos_disk' succeeded getting device statistic for /dev/gvinum/vhost_small

which looks okay for me (monit notified me that data access succeeded) but than:

'athos_disk' filesystem doesn't support inodes
'athos_disk' filesystem doesn't support inodes
'athos_disk' space usage 100.0% matches resource limit [space usage>99.0%]

which is totally wrong:

# df -h
/dev/gvinum/vhost_small 9.7G 231M 8.7G 3% /data/jails/vhost_small

Am I doing something wrong here ?
Any help would be appreciated.

Thx for listening
Peter Klett

netkey information technology gmbh
st.veitgasse 4 / top 11 | a-1130 vienna | austria
t +43 1 888 49 93 -21 | f dw -25
e address@hidden | i

reply via email to

[Prev in Thread] Current Thread [Next in Thread]