Forum OpenACS Q&A: Fixing Up Monitoring:

Posted by Carl Coryell-Martin on
Right now the manual interface for watchdog is broken on all of my acs5 servers because AOLserver claims that it can't find the file when it tries to exec the script, but info exists $command returns 1.

here is the snippet from the error log:
Notice: command: /export/staging/mdb/packages/monitoring/bin/
[29/Oct/2004:14:37:26][28860.3056282544][-conn:staging-mdb::1] Error: Watchdog(wd_errors): couldn't execute "/export/staging/mdb/packages/monitoring/bin/": no such file or directory
    while executing
"exec $command $options [ns_info log]"

and here is the relevant source code snippet:
        set command [ad_parameter -package_id [monitoring_pkg_id] WatchDogParser monitoring $default_command]
	ns_log notice command: $command
        if { ![file exists $command] } {
            ns_log Error "Watchdog($proc_name): Can't find WatchDogParser: $command doesn't exist" 
        } else {
            # This has been changed from the previous version's concat
            # because it did not work.  Some quick testing
            # did not reveal an elegant solution, so we're going back
            # to the old less-elegant-but-functional solution

            if { [catch { set result [exec $command $options [ns_info log]] } err_msg] } {
                global errorInfo
                ns_log Error "Watchdog($proc_name): $errorInfo"
                return ""
            } else {
                return $result
notice that it only attempts to exec the command after it finds the script.

I am currently stumped and would love a suggestion.

oh, here are the permissions on the file in question:
[carl 14:49:28 /export/staging/mdb/packages/monitoring/bin]$ ls -las
total 20
   4 drwxrwxr-x    3 carl     users        4096 Oct 27 12:49 .
   4 drwxrwxr-x    7 carl     users        4096 Oct 27 12:49 ..
   8 -rwxrwxrwx    1 carl     users        6009 Apr  1  2003
   4 drwxrwxrwx    2 carl     users        4096 Oct 27 12:49 CVS
[carl 14:49:29 /export/staging/mdb/packages/monitoring/bin]$ 

Thank You,

Carl C-M
Posted by Janine Ohmer on
Carl, check to see if the path to perl is correct in  You can get this error message if the interpreter the shell is trying to hand off to can't be found.  I can't tell you how much time I wasted on that one before I finally started remembering to check for it!
Posted by Andrew Piskorski on
You're still using the Perl script for Watchdog? Why? I thought I contributed a Tcl proc version of that years ago. Hm, yes, I did, and at least on the Head, proc wd_errors defaults to -external_parser_p 0, which calls the wd_aolserver_errors Tcl proc rather than exec'ing

Are you using the Perl script version purposely, or by accident? If by accident, I recommend trying the Tcl version instead.

Posted by Carsten Clasohm on
Even on Head, the external script is still called by watchdog/index.tcl:

wd_errors -external_parser_p 1 ...

The Tcl version is only used by the scheduled procedure.