Posting to Hubot via Curl - heroku

I'm running Hubot on Heroku and have connected it to Hipchat.
I'd now like to use Curl to post third-party information to the Hubot, when appropriate.
There are two scripts that seem the right fit, http-post-say.coffee or http-say.coffee. I can't get either to work.
http-post-say points to port 8080, which I don't believe will work on Heroku, and http-say simply doesn't post, without any error message.
Both scripts have zero config, and I've successfully deployed several other scripts, so I'm at a loss.
Has anyone successfully used either script in the scenario I've described, or taken a different approach to reach the same goal?

This answer is a bit late.
httpd-post-say just worked for me ignore the port 8080 for heroku just use your app url (app-name.herokuapp.com). The more confusing thing for me was for room you need to use the XMPP JID which looks like 12345_something#conf.hipchat.com. So to post a message it would look as follows for heroku.
curl -X POST http://app-name.herokuapp.com/hubot/say -d message='Hello World' -d room='12345_room_name#conf.hipchat.com'

Related

curl api call failing on platform.sh hook

I'm trying to implement a message sending on my platform.sh server. The idea would be to use the existing hooks:deploy: hook in the configuration file to make a bash curl call that would send a message to an api "Deploy completed".
I use a curl snippet that works like a charm on my local machine, though the message is never sent from the server on a new deploy.
I know that the correct interpreter is bash, since the existing example in platform.sh docs is using bash code. Though, it's indicated in the docs that the disk is in read-only mode during this hook, would that be the cause of the issue?
Thanks a lot!
~SPJ
For posterity: also note that this may already exist by default in Platform.sh you can use the webhook integration to get notified of any activity.
$ platform integration:add --type=webhook --url=A-URL-THAT-CAN-RECEIVE-THE-POSTED-JSON
Details on https://docs.platform.sh/administration/integrations/webhooks.html
Hmm, I thought it was irrelevant, but French text with accents in the API parameters was causing the issue...
Hope this will help others.
~SPJ

Running ‘heroku run:detached’ programmatically. How exactly?

I've tried googling and stackoverflowing this and all I get is links back to the API reference or examples of scaling dynos, which is not what I want.
heroku run:detached is great as it just spins up a dyno with your app, runs whatever you want, then spins down the dyno.
How do I achieve the exact same things but using the Heroku Platform API?
I've seen people mention you have to use the Dyno endpoint on the API, but how? Can someone offer an exact example of how I would run the following from the API?
$ heroku run:detached --size 2x rake my_task.rb
You can use the platform API to to this, and create a dyno.
See https://devcenter.heroku.com/articles/platform-api-reference#dyno-create
By sending a POST request to /apps/your_app_name/dynos with the following parameters:
command, the command you wich to run.
attach, set it to false.
This will create a one-off dyno and detach it.
This is what the toolbelt does when you run the run:detached command. You can see how it works here: https://github.com/heroku/heroku/blob/01cd753570cb62b917843112fb29d1cdd43ba335/lib/heroku/command/run.rb#L65

Sending automated alerts through a XMPP server via command line? (WINDOWS)

I've spent hours trying to figure out the answer to this and just continue to come up empty handed. I've setup a XMPP server through OpenFire that is fully functional. My goal with creating the server was placing an alert system for when an event is completed on my server. For example when one of my renders is finished rendering (takes hours, sometimes days), it has the option of running a command when it's finished. This command would then run a .bat file telling a theoretical program to send a message via the broadcast plugin in OpenFire to all parties involved in the render. So it needs to be able to receive parameters such as %N for name of the render and %L for the label of it.
I've located two programs that do exactly what I'm looking to do but one does not work and from the sounds of the comments may have never worked and the second one is seemingly LINUX only. The render server is Windows as is the OpenFire server so naturally it would not work. Here are the links though so you can get an idea.
http://thwack.solarwinds.com/media/40/orion-npm-content/general/136769/xmpp-command-line-client/
http://manpages.ubuntu.com/manpages/jaunty/man1/sendxmpp.1.html
Basically the command I want to push is identical to that of the first link.
xmppalert.exe -m "%N is complete." %L#broadcast.myserver
This would broadcast to everyone in the labels Group that the named render is complete.
If anyone has any idea how to get either of the above links working, know of another way or simply have a better idea on how to accomplish what I'm trying to do please let me know. This is something that has been eating at me for 2 days now.
Thanks.
you can take a look at PoshXMPP which allows you to use XMPP from the Powershell.
http://poshxmpp.codeplex.com/
Alex

concurrent curl POST requests

What's the quickest way to create concurrent curl requests? I have a app which accepts POST requests and would like to do some load testing
I would like to run the following cURL command concurrently and not sequentially
curl -d "param1=value1&param2=value2" http://example.com/test
Thanks
How about ApacheBench? You've probably already got it installed.
I am not confident but spawning multiple processes in the bachground?
nohup curl -parameters &
For load testing perhaps you need something like multi-threading, you might also want to research for already available tools.
I do this kind of thing (generating concurrent POST requests) with a few small perl scripts I wrote:
http://patrick.net/sprocket/rwt.html
I'm planning to port it to python, but the perl version works pretty well right now.

How can I remotely watch logs on Win2003 servers?

(Briefly, like this question but for Windows servers.)
I have several Win2003 servers running custom application services (C/C++, not Java) that write text-based logs in a custom format.
[2009-07-17 12:34:56.7890]\t INFO\t<ThreadID>\tLog message...
[2009-07-17 12:34:56.7890]\t *WARN\t<ThreadID>\tLog message...
[2009-07-17 12:34:56.7890]\t**ERR \t<ThreadID>\tLog message...
I would like to have a way to easily and efficiently (over a not-very-fast VPN) "watch" these logs for lines that match a pattern (like tail -f |grep -E on linux). Ideally the output would need to be aggregated, not one window/shell per file or per server, and a Windows application would be best, so that I can put it in front of people who are command-line-phobic.
Any recommendations?
edit: fixed link
Try using baretail
splunk from www.splunk.com is the way to go. It is free & does exactly what you are asking for.

Resources