I am trying to configure a trigger in Zabbix in order to monitore a simple eventLog from a Windows server. The trigger works and an alarm raises but after 30s without this event it should get back to normal. But the problem is it never gets back to normal.
Here is the expression
{SERVER1:eventlog[Application,,,,15007,,skip].logeventid(15007)}=1
and
Recovery Expression
{SERVER1:eventlog[Application,,,,15007,,skip].nodata(30)}=1
Try this:
Here is the expression
{SERVER1:eventlog[Application,,,,15007].logeventid(15007)}=1
and {SERVER1:eventlog[Application,,,,15007].nodata(30)}=0
Recovery Expression
{SERVER1:eventlog[Application,,,,15007].nodata(30)}=1
Related
I am writing a small program in Progress that needs to write an error message to the system's standard error. What ways, simple if at all possible, can I use to print to standard error?
I am using OpenEdge 11.3.
When on Windows (10.2B+) you can use .NET:
System.Console:Error:WriteLine ("This is an error message") .
together with
prowin32 2> stderr.out
Progress doesn't provide a way to write to stderr - the easiest way I can think of is to output-through an external program that takes stdin and echoes it to stderr.
You could look into LOG-MANAGER:WRITE-MESSAGE. It won't log to standard output or standard error, but to a client-specific log. This log should be monitored in any case (specifically if the client is an application server).
From the documentation:
For an interactive or batch client, the WRITE-MESSAGE( ) method writes the log entries to the log file specified by the LOGFILE-NAME attribute or the Client Logging (-clientlog) startup parameter. For WebSpeed agents and AppServer servers, the WRITE-MESSAGE() method writes the log entries to the server log file. For DataServers, the WRITE-MESSAGE() method writes the log entries to the log file specified by the DataServer Logging (-dslog) startup parameter.
LOG-MANAGER:WRITE-MESSAGE("Got here, x=" + STRING(x), "DEBUG1").
Will write this in the log:
[04/12/05#13:19:19.742-0500] P-003616 T-001984 1 4GL DEBUG1 Got here, x=5
There are quite a lot of options regarding the LOG-MANAGER system, what messages to display, where the file is placed, etc.
There is no easy way, but in Unixen you can always do something like this using OUTPUT THROUGH (untested):
output through "cat >&2" no-echo unbuffered.
Alternatively -- and this is tested -- if you just want error messages from a batch-mode program to go to standard out then
output through "tee" ...
...definitely works.
Say I want to use FTP in Python using the ftplib. I begin with this:
from ftplib import ftp
ftp = FTP('10.10.10.151')
If the FTP server is not online, however, it will hang right there indefinitely. The only thing that can kick it out is a keyboard interrupt as far as I know. I've tried this:
ftp.connect('10.10.10.151','21', 5)
With the five being a five second timeout. But the problem here is that I do not know of any way to use that line without first assigning ftp something. But if the server is offline, then the "ftp =" line will hang. So what use is ftp.connect()'s timeout function?!?
Does anybody know a workaround or anything? Is there a way to time out the "ftp = FTP(xxx)" command that I haven't found? Thanks.
I'm using Python 2.7 on Linux Mint.
Your call to connect() is redundant since FTP() method documentation states:
When host is given, the method call connect(host) is made.
Also, since Python 2.6, FTP() does have a timeout parameter:
class ftplib.FTP([host[, user[, passwd[, acct[, timeout]]]]])
The optional timeout parameter specifies a timeout in seconds for blocking operations like the connection attempt (if is not specified, the global default timeout setting will be used).
Our app is hosted on heroku and we use delayed job when sending info to a remote system (via a GET to a url with some url params)
the remote system returns a success code usually, but it it;s real busy it returns a tryagain code.
suppose the our method is
def send_info
the_url = "http://mydomain.com/dosomething?arg=#{self.someval}"
the_result = open(the_url).read
successflag = get_success_flag_from(the_result)
end
and so somewhere in our code we do
#widget.delay.send_info
and that all works fine.
Except it does not automatically handle the case where the remote said to try back later.
Is there any way for the send_info method (which is what delayed job will execute) to "tell" delayed_job "retry me again"? Do we need to throw some custom exception or something?
Raising any kind of exception ought to cause delayed_job to requeue it (subject to only-trying-so-many-times); if you don't especially need a custom exception you can just raise a RuntimeError.
Having a strange problem where a print occasionally is not being printed
The scenario is that we print barcode labels with a barcode printer (Zebra LP2844).
Printer is plugged into the TerminalPC and then shared.
Printer->TerminalPC -> Terminal Server.
Session on TerminalServer is using Printer as \TerminalPC\Printer
When logging print Events we see the following:
Print OK:
1) Print OK (Event 10, User myUser)
2) Print deleted (Event 13, User NT-AUTHORITY\SYSTEM)
Print not OK => only Event 2) appears in the event log
Anybody having a clue about what is happening here?
More information:
This problems occurs about 2 out of 10 times. Only difference is an increasing ID being printed as part af the barcode.
The barcode is the only object being printed. It saves to file (*.emf) every time - and looks fine on file.
The application is developed using Delphi 2010 and works fine in all other ways.
Print jobs are removed from the print spooler by the port monitor. The port monitor "EndDocPort" function calls "SetJob" with JOB_CONTROL_SENT_TO_PRINTER to indicate the the job has finished, and this removes it from the spooler.
If the printer uses a custom port monitor, the problem could be in the printer driver or custom port monitor. If it uses a standard port such as LPT or USB, it's more likely a problem with the application not calling "EndDoc" consistently, or not checking return codes from EndDoc.
I have a basic mochiweb polling loop that looks like the following, except it does other things instead of printing to the console and eventually returns:
blah() ->
io:format("Blah")
blah()
loop(Req) ->
PathParts = string:tokens(Req:get(path), "/")
case PathParts of
["poll"] ->
blah()
This works great until the client aborts their request. For instance if the client window is closed, this process keeps running indefinitely.
I would like to know if there is an option in mochiweb's start() or maybe something else I'm overlooking that would have mochiweb automatically terminate this process, or at least send a message on client abort. Any ideas?
Looks like one solution is setting up another process to repeatedly call gen_tcp:recv(Req:get(socket), 0, 1) and looking for the result {error, closed}, then killing the polling process if it is received... Not sure if that's optimal though.