Cannot figure out how to get the twilio API to work in home assistant - configuration-files

Ok, so I am using home assistant to automatically send myself a message at certain times of the day using the twilio api.
https://home-assistant.io/getting-started/troubleshooting-configuration/
It is all done in the configuration.yaml file, so here is what mine looks like:
notify:
- name: Cody Wirth
platform: twilio_sms
account_sid: AC8a4f2f40331bdad5c95265f2cefe26a2
auth_token: 33a693e18dcad513d4791c51f1071227
from_number: "+16142896777"
automation:
- alias: Send message at a given time
trigger:
platform: time
hours: 24
minutes: 47
seconds: 15
action:
service: notify.twilio_sms
data:
message: 'The sun has set'
target:
- "+16147059227"
Is there anything wrong with my syntax? Is there something I need to configure on Twilio's end to make the messages come through to my phone? Nothing at all is happening when I automate the messages to send.
Ok, so this is the error that it returns:
"17-01-12 08:17:44 WARNING (MainThread) [homeassistant.core] Unable to find service notify/twilio_sms"

To be able to use twilio, you first need to enable/configure the twilio component.
The automation does not configure or start the twilio component, it just uses it.
You can find the configuration documentation on the twilio component page:
twilio:
account_sid: ACCOUNT_SID_FROM_TWILIO
auth_token: AUTH_TOKEN_FROM_TWILIO
After you configured it (and restarted home-assistant), your automation should be able to send notifications over it.

Related

How do I modify existing jobs to switch owner?

I installed Rundeck v3.3.5 (on CentOS 7 via RPM) to replace an old Rundeck instance that was decommissioned. I did the export/import of projects (which worked brilliantly) while connected to the new server as the default admin user. The imported jobs run properly on the correct schedule. I subsequently configured the new server to use LDAP authentication and configured ACLs for users/roles. That also works properly.
However, I see an error like this in the service.log:
ERROR services.NotificationService - Error sending notification email to foo#bar.com for Execution 9358 Error executing tag <g:render>: could not initialize proxy [rundeck.Workflow#9468] - no Session
My thought is to switch job owners from admin to a user that exists in LDAP. I mean, I would like to switch job owners regardless, but I'm also hoping it addresses the error.
Is there a way in the web interface or using rd that I can bulk-modify jobs to switch the owner?
It turns out that the error in the log was caused by notification settings in an included job. I didn't realize that notifications were configured on the parameterized shared job definition, but there were; removing the notification settings caused the error to stop being added to /var/log/rundeck/service.log.
To illustrate the problem, here are chunks of YAML I've edited to show just the important parts. Here's the common job:
- description: Do the actual work with arguments passed
group: jobs/common
id: a618ceb6-f966-49cf-96c5-03a0c2efb9d8
name: do_the_work
notification:
onstart:
email:
attachType: file
recipients: ops#company.com
subject: Actual work being started
notifyAvgDurationThreshold: null
options:
- enforced: true
name: do_the_job
required: true
values:
- yes
- no
valuesListDelimiter: ','
- enforced: true
name: fail_a_lot
required: true
values:
- yes
- no
valuesListDelimiter: ','
scheduleEnabled: false
sequence:
commands:
- description: The actual work
script: |-
#!/bin/bash
echo ${RD_OPTION_DO_THE_JOB} ${RD_OPTION_FAIL_A_LOT}
keepgoing: false
strategy: node-first
timeout: '60'
uuid: a618ceb6-f966-49cf-96c5-03a0c2efb9d8
And here's the job that calls it (the one that is scheduled and causes an error to show up in the log when it runs):
- description: Do the job
group: jobs/individual
name: do_the_job
...
notification:
onfailure:
email:
recipients: ops#company.com
subject: '[Rundeck] Failure of ${job.name}'
notifyAvgDurationThreshold: null
...
sequence:
commands:
- description: Call the job that does the work
jobref:
args: -do_the_job yes -fail_a_lot no
group: jobs/common
name: do_the_work
If I remove the notification settings from the common job, the error in the log goes away. I'm not sure if sending notifications from an included job is not supported. It would be useful to me if it was, so I could place notification settings in a single location. However, I can understand why it presents a problem for the scheduler/executor.

How to collect more than 22 event ids with winlogbeat?

I've got a task to collect over 500 events from DC with winlogbeat. But windows got a limit 22 events to query. I'm using version 6.1.2. I've tried with processors like this:
winlogbeat.event_logs:
- name: Security
processors:
- drop_event.when.not.or:
- equals.event_id: 4618
...
but with these settings client doesn't work, nothing in logs. If I run it from exe file it just starts and stops with no error.
If I try to do like it was written in the official manual:
winlogbeat.event_logs:
- name: Security
event_id: ...
processors:
- drop_event.when.not.or:
- equals.event_id: 4618
...
client just crashes with "invalid event log key processors found". Also I've tried to create new custom view and take event from there, but apparently it also has query limit to 22 events.

Rundeck and Hipchat Plugin

I am configuring Rundeck in my work and I want to receive all notifications from jobs via Hipchat. I have found this plugin: https://github.com/hbakkum/rundeck-hipchat-plugin
I copied .jar file in Rundeck libext directory and now I see Hipchat option in Job notification. Despite the fact that I wrote the room ID and I get a token to allow Rundeck sends notifications to this room, nothing happens..
I saw this topic: https://github.com/rundeck/rundeck/issues/764
Also I am getting this logs:
2018-01-31 15:15:12,122 [quartzScheduler_Worker-3] INFO grails.app.services.rundeck.services.ExecutionUtilService - Execution successful: 13 in project proyecto_prueba
2018-01-31 15:15:12,501 [quartzScheduler_Worker-3] INFO grails.app.services.rundeck.services.ExecutionService - updated scheduled Execution
2018-01-31 15:15:31,088 [quartzScheduler_Worker-4] ERROR grails.app.services.rundeck.services.PluginService - Notification: configuration was not valid for plugin 'HipChatNotification': apiAuthToken: required
is Hipchat plugin working wrong because last update was in 2016 or Am I configuring something wrong?
Thanks beforehand.
Regards,
Mike.
I found the issue. Hipchat API Token has to have next scopes: Send notification y View Room. With these scopes, I have to specify next lines in Rundeck config files:
configure framework:
framework.plugin.Notification.HipChatNotification.apiVersion=v2
framework.plugin.Notification.HipChatNotification.apiAuthToken=value
configure project:
project.plugin.Notification.HipChatNotification.apiVersion=v2
project.plugin.Notification.HipChatNotification.apiAuthToken=value

cli showing unknown sip registration in asterisk

I am using asterisk 11.9.0 everything works fine but cli shows unknown sip registrations with my current code running
my cli output
-- Hungup 'DAHDI/i1/9560790782-2fd2'
[Jun 24 14:55:24] NOTICE[3637]: chan_sip.c:25757 handle_request_register: Registration from '"4001" <sip:4001#182.74.197.19:5060>' failed for '37.8.47.82:22939' - Wrong password
[Jun 24 14:55:25] NOTICE[3637]: chan_sip.c:25757 handle_request_register: Registration from '"3822" <sip:3822#182.74.197.19:5060>' failed for '37.8.47.82:23187' - Wrong password
[Jun 24 14:55:29] NOTICE[3637]: chan_sip.c:25757 handle_request_register: Registration from '"5555" <sip:5555#182.74.197.19:5060>' failed for '37.8.47.82:22848' - Wrong password
how can i remove this because my dialplan is taking too much time to execute as compared to the past.
Any help would be appreciated.
Very likly that is automated programs(bots) with goal find your secrets/on success call out to Cuba or other costly destinations.
Every asterisk installation need have at least rate limiter - usually fail2ban.org used. That will prevent bots from spamming too fast.

Not able to send/receive email from Jenkins using Email-ext plugin

I am using Jenkins ver. 1.463 running on 32-bit Windows Server. I have installed Email-ext plugin version 2.30.2.
I am unable to get any email notifications.
What i am trying to do - is send an email after every job - irrespective of whether the operation is success, failure, abort, not-build, etc..
I am using Jenkins to run Automated Test Suites.
The way i have configured a test job is "In the Post-Build Actions , have selected Editable Email Notification", and filled in the required fields(recipient list,etc). In the Advanced - selected all the triggers from dropdown such as "Success, Failure, Aborted, Regression, Fixed, Not-Built, Stable.
i have verified the smtp server, recipients, Still I am unable to get any email,
in the Console Output of the job i see the following lines
Email was triggered for: Success
Sending email for trigger: Success.
In the Jenkins Server, in the "jenkins.err.log", see the following error message / exception being thrown, but dont know the exact cause
Aug 27, 2013 5:41:57 PM hudson.model.Run run
INFO: TestJob-for-Email #7 main build action completed: SUCCESS
Aug 27, 2013 5:41:58 PM hudson.model.Executor run
SEVERE: Executor threw an exception
java.lang.NoSuchMethodError: hudson.model.AbstractBuild.getPreviousBuild()Lhudson/model/AbstractBuild;
at hudson.plugins.emailext.plugins.content.BuildStatusContent.evaluate(BuildStatusContent.java:71)
at org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro.evaluate(DataBoundTokenMacro.java:177)
at org.jenkinsci.plugins.tokenmacro.TokenMacro.expand(TokenMacro.java:177)
at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:219)
at hudson.plugins.emailext.plugins.ContentBuilder.transformText(ContentBuilder.java:63)
at hudson.plugins.emailext.ExtendedEmailPublisher.setSubject(ExtendedEmailPublisher.java:687)
at hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:485)
at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:319)
at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:311)
at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:271)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:710)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:685)
at hudson.maven.MavenModuleSetBuild$RunnerImpl.cleanUp(MavenModuleSetBuild.java:1018)
at hudson.model.Run.run(Run.java:1478)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:239)
Could someone please help,Thanks a lot!
You need to upgrade Jenkins. Your version is too old for the version of the email-ext plugin that you're using. See https://issues.jenkins-ci.org/browse/JENKINS-18728