elastalert configure slack notification - elastalert

hi trying configure slack notification in test.yaml file , getting the below error ERROR:root:Could not load rule /opt/rules/test.yaml: Error initiating alert ['slack', {'slack_webhook_url': 'https://hooks.slack.com/servichttps://hooks.slack.com/services/abcd'}]: Could not import module slack_webhook_url: need more than 1 value to unpack
alert:
"slack"
slack_webhook_url: "https://hooks.slack.com/servichttps://hooks.slack.com/services/abcd"
is this the correct way to define the slack alert

Make sure you follow the spaces correctly and you are providing all the required arguments:
alert:
- "slack"
slack:
slack_webhook_url: "YOUR URL"
It should work.

Related

Jenkins attaching local image in email

I am facing a problem in following scenario.
i have configured am email to be send after the job is succeed in Jenkins. In that email i am attaching local image to send it over email to other users, using html
The problem i am facing here is once the mail is in my outlook inbox i can download and see the embedded image on my machine but when i open the same email on different user's machine its not displaying image its showing "X" mark.
Please help to resolve the issue.
OK , so assuming you are using a declarative pipeline (because im not sure if you are using pipeline or regular job), you can add this code to your post stage :
post {
always {
echo 'I have finished'
archiveArtifacts 'yourfile.html or any extension'
emailext attachLog: true,
attachmentsPattern: '*.html',
body: 'Smoke Test.\n\nPlease see attachment for Report and build Logs', subject: 'DO NOT REPLY: JENKINS Build Server Notification [${BUILD_STATUS}]${JOB_NAME} Build #${BUILD_NUMBER}', to: 'example#example.com'
}
if you attachment (in my case is yourfile.html) is in your root directory then *.html is good to pick it up, otherwise pass the absolute path to your attachment.
Note : that its better always to archive the artifacts or the files you are trying to use later in the build or in other builds.
Also, make sure you have email extension plugin: Email extension plugin

I am not receiving an email from a Anypoint Cloudhub Alert

I have set up a custom alert in Anypoint Cloudhub to raise the alert if the application encounters a mongodb error. I am seeing the error but am not receiving an email.
I am down as the recipient and have the alert turned on but I cannot see an alert (which I think should be an email).
I'm using Mule 3.8.3 in Runtime Manager.
Alert:
Error in log:
********************************************************************************
18:27:45.629 02/27/2017 Worker-0 [test].HTTP_Listener_Configuration.worker.01 ERROR
********************************************************************************
Message : Failed to invoke findOneDocument.
Element : /getRecord/processors/4 # test
--------------------------------------------------------------------------------
Exception stack is:
Failed to invoke findOneDocument. (org.mule.api.MessagingException)
com.mongodb.connection.BaseCluster.createTimeoutException(BaseCluster.java:369)
Are you using the CloudHub connector to generate the custom alert notification? Are you sure the alert contains com.mongodb? Also, are you sure you set a valid email address for the notification? Are you also seeing the Alert in Runtime Manager? Make sure you set a Anypoint Platform user as the alert recipient and that that user has permission to view alerts from this business-group/environment.

Failed to send notification.: Internal server error. No devices

I am getting the error below when sending push notification to android devices
{ code: 'FPWSE0009E',
message: 'Internal server error. No devices found.',
productVersion: '8.0.0.00-20161122-1902'
}
I have done the following verification:
1: Verify that the device show up in the MFP console
2: Verify that the device is register by executing the rest call ->https://myservre/mfpadmin/management-apis/2.0/runtimes/mfp/devices and
3: The below activity is in the manifest file
<activity android:name="com.ibm.mobilefirstplatform.clientsdk.android.push.api.MFPPushNotificationHandler" android:theme="#android:style/Theme.NoDisplay" />
4: Added the scope 'push.mobileclient'
This issue only happens for Android devices . I can send push notification to iOS phones..
Thanks for your help
I do not see listed a step saying that you visited the FCM console, copied from there the project identifier and senderId values and added those in the MobileFirst Console.
This step is part of the instructions, here: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/notifications/sending-notifications/#google-cloud-messaging--firebase-cloud-messaging
Once you do that, delete the app from the device and reinstall it.
If it fails still then also add the full LogCat log from when you open the device until after you get the error in the console.

Tracker GV500 - Device management

I currently registered my Quecklink GV500 to cumulocity and I'm able to receive some events and measurements.
But when I try to send command to my Quecklink GV500 registered in Cumulocity but I always hava a FAILED response. For example, I tried to send this command (which is fully supported by the GV500) from SHELL tab: AT+GTTMA=gv500,+,1,0,0,,,,,,FFFF$
And as result I got:
Failure reason: Command currently not supported
I also tried to get the agent logs by using "Log file request" in the "Log" tab of my Device and as result I got:
Failure reason: Cannot build command. Search parameters only allow the
following characters [a-zA-Z0-9_]
Is it normal?
When I look the general information in "Info" tab I have:
Send connection: online
Push connection: inactive
Is it normal that Push connection is marked as inactive?
The tracker-agent in it current state does not use a push connection for receiving operations but does a polling of the operations. Therefore the push connection is always shown as inactive.
If you receive "Failure reason: Command currently not supported" it is an error from the agent not the device. The agent seems not to support shell operations for Queclink.
As for the error on the log file request it seems that there was an unsupported character in the search parameter. Maybe you can share what you entered for the parameters in the UI
Thanks for your answer. For the log file request I let blank value in the search input field. If I try to enter "gl200", I get the following error: Command currently not supported.
So to resume can you confirm that Quecklink devices can't be managed from Cumulocity for the moment? It's supported for which device?

How to override default action when Apps cannot connect to Server?

The apps shows below screen when the connection to server is unsuccessful, but our customer doesn't wan the user to be able to view the "Details" of the error which I had no idea how to remove it. Can we override the default behaviour and show a custom screen instead?
Thanks in advance.
You can use WL.Client.Connect API to connect to Worklight server, and use it's onSuccess and onFailure callback functions to show the users whatever you want. More information can be found here: http://pic.dhe.ibm.com/infocenter/wrklight/v6r1m0/topic/com.ibm.worklight.dev.doc/devref/t_ConnectingToWorklightServer.html?resultof=%22%63%6f%6e%6e%65%63%74%22%20
If you had specified the
ConnectOnStartUp=true
in initOption js file then on starting up itself it will try to connect with the server , In that case use there will a for connection failure,it will be commented first in init Option.You have to uncomment it in initOption js file and give something to do when the connection has failed in that function . So the error will be customized