How can I configure zabbix to send me the content of a logfile in email alert? I have an alert that sends me an email when a new line is added in a logfile and I want to add the last line in the email.
How can I do this?
If you alert based on a trigger like {host:log[/tmp/file.txt].strlen()} <> 0, then you can use {ITEM.VALUE} macro to refer to the item value that triggered the alert. If there are several items in a trigger, use an indexed version of this macro like {ITEM.VALUE2} to refer to the second item in the trigger expression. The default notification message that comes with Zabbix includes these macros, so if you have not changed it, it should work out of the box.
Please see Using macros in messages section in the official documentation for more information.
Related
I'm a newbie. I just created a webhook and trigger to add CCs to newly created tickets following these instructions:
https://support.sweethawk.com/hc/en-us/articles/360056870852-Using-Zendesk-triggers-to-add-CCs-to-a-ticket
The idea here is that I have a macro that I run on a new ticket that automatically adds CCs based on the tag in the macro. This method works, but unfortunately it sends the same initial message twice and doubles my signature like so:
https://imgur.com/a/Rp2iVwb
I apologize for all the censorship. I currently have no choice but to do this in a production environment. The blue is my company, the red is me (both agent and the requester), and the green is the test email I want to CC.
I have tried lots of different ways to get this to add the CC and send without doubling the message and signature, and finally ended up here after my most recent attempt. I'd like to know why exactly it doesn't work (and if anyone has a solution obviously). What I have done is modify the JSON from the instructional link above to not include a copy of the ticket description and instead just add the CC. I then created an additional trigger that will send the ticket description upon creation of the ticket. This second trigger successfully sends a single copy of the ticket description. However, my modified JSON doesn't add the CC. Can anyone tell me what's wrong with it?
{
"ticket": {
"email_ccs": {
"user_email": "mmmediainc#protonmail.com",
"action": "put"
}
}
}
My script is to hide some pages for the some login User. My script get trigger well in Client not in Webplayer.
To trigger this script i created the Data function property with Input and output parameter.
Input parameter as sysdate
output assigned to document property where below script is present.
import Spotfire.Dxp
from Spotfire.Dxp.Data import *
table=Document.Data.Tables["RestrictedSSO"]
minCol=table.Columns['GROUPNAME']
minCursor=DataValueCursor.Create(minCol)
for row in table.GetRows(minCursor):
Document.Properties["UserGroup"]= minCursor.CurrentValue;
if Document.Properties["UserGroup"]=="Restricted":
for Page in Document.Pages:
if Page.Title == "ABCD":
Document.Pages.Remove(Page)
if Page.Title == "EFGH":
Document.Pages.Remove(Page)
First check if there is a URL specified for the TERR Engine. A default setting might work in the client and not in the webplayer, so specifying the URL can ensure it works in both Client and Webplayer.
If that still does not help you can choose to initiate the python script via Javascript instead of the TERR sysdate output : https://community.tibco.com/wiki/how-trigger-python-script-report-load-javascript-tibco-spotfire
When using TERR Check whether you have have checked refresh automatically and unchecked allow cache from script in data function.
Run terr on server rather than run locally.
Go to file-> Document properties -> uncheck Remember personalized view for each web client user.
Even after doing the above steps if it didn't worked , then you can also go with java script.
Each day I receive an email with a CSV/excel attachment With a list of email addresses. I’d like to automatically take these addresses and mail an email template to all of them. The catch is, it has to be done on a work computer so I can’t download any additional programs to help with it. This will need to be done with native Windows apps. I’ve tried using VBA without success (I’m not well versed). Any help would be appreciated.
You can develop a VBA macro or COM add-in if you are going to distribute the solution to multiple machines. Basically, you need to handle the NewMailEx event of the Application class. This event fires once for every received item that is processed by Microsoft Outlook. The item can be one of several different item types, for example, MailItem, MeetingItem, or SharingItem. The EntryIDsCollection string contains the Entry ID that corresponds to that item. The NewMailEx event fires when a new message arrives in the Inbox and before client rule processing occurs. You can use the Entry ID returned in the EntryIDCollection array to call the NameSpace.GetItemFromID method and process the item.
Private Sub Applicaition_NewMailEx(ByVal EntryIDCollection As String)
Dim mai As Object
Set mai = Application.Session.GetItemFromID(strEntryId)
MsgBox mai.Subject
End Sub
In the event handler, you need to save the attached Excel file to the hard drive. Then you can automate Excel to open the file and read its content for creating a new item based on a template saved. Read more about these actions in the following articles:
How To: Create a new Outlook message based on a template
How To: Create and send an Outlook message programmatically
How To: Fill TO,CC and BCC fields in Outlook programmatically
I've written a script that sends an hourly email to me using:
MailApp.sendEmail("john#doe.com", "Status Update", currentStatus);
My only gripe is that every message I get is treated as a separate thread, despite the subject lines all being the same. I'd prefer if all were threaded so I can see the stream of messages in one place.
Is there any way to have new status messages appended to the same thread?
Will this require using GMailApp functions instead?
EDIT (2016-08-26): I have solved my problem using the following method/workaround:
Include a unique "marker" somewhere in the status message. I use a static UUID that I generated online.
Use GmailApp.search() to find the thread with the status message(s) by looking for the unique marker.
Use GmailApp.reply() to add a new status message to the thread.
This keeps all the status messages together as desired. Perhaps there's a more elegant way to do this but this works...
I need trigger able to detect that polled Zabbix agent items does not returns data.
For zabbix trapper items this functionality is covered by nodata() function (Heartbeat lost detection in Zabbix documentation) but I need similar functionality supported for Zabbix agent items.
For example, a have defined Zabbix agent UserParameter:
UserParameter=custom.mssqlping,/usr/local/scripts/mssqlping.sh.
The script mssqlping.sh returns 0/1. I need to cover situation when mssqlping.sh script is broken and returns empy string, which is not stored in zabbix because it is not number.
How to detect that periodically polled item data are no longer coming?
It is not that it's not stored that creates the problem but the fact that it is not being considered as a valid item anymore so you can't trigger anything out of it. There is a plenty of related bug reports related to it. AFAIk your options:
Adjust the script to return a numeric value in case of errors
Use 2.2's "internal events" to detect the "becomes unsupported" event
Make and external script that will query the database directly and will notify you on its own or triggering a condition through zabbix's trappers
Or the option here is to trigger based on nodata()
from: https://www.zabbix.com/forum/zabbix-help/41652-zabbix-trigger-timeout?p=245422#post245422
{myserver:example.iregexp("/string/",1m)}=1 AND {myserver:example.nodata(1m)}=0
some more reading: https://zabbix.org/wiki/Trigger_examples