Flex / AIR - Can it receive SYSLOG notices? - apache-flex

Is there a way for Flex / AIR to receive syslog notices from devices such as cisco switches etc? Does anyone know of any information I can read or sites to look at?

If you are talking about calling native methods, flex/air cannot do that. But there is an opensource AIR-Java bridge namely merapi that lets you connect your AIR app with java code. I guess java should be able to do what you are looking for.

AIR apps can read local files. In the case of receiving syslog notices from cisco switches or other devices, I used to set them up on the receiving machine to be added to the local syslog there to have everything in one place (we're not talking windows here :-)). Using mtail and grep I had a few consoles open that showed me what was coming in.
If you write an Actionscript parser to read your local syslog - using bytearray like described here - then it should be possible to read through the whole file and note the interesting bits (I haven't done this myself, so no guarantees!)
If it more a question of getting real time data from devices, I would look into snmp (but you will probably need to write additional stuff in php or python to query the devices for you).

Related

Which protocol to use for multi-stream application ? RTMP?

I'm trying to stream several iPad screen to a single python client (computer) on a local network but I don't know which protocol to use.
I can do it with 1 Ipad using MonaServer, an app that stream on RTMP and a little Python script to read the video.
But I am dealing with problems to use several Ipads because as I saw RTMP uses a single port on Windows, :1935 and I am not sure it's possible to multi-stream with RTMP.
I am not a pro with networking, so if you have any suggestions I'm open
What you need is to following the wiki and usage of open source projects, to get some instincts about multiple clients live streaming.
For example, you could use OBS to publish some streams to a media server, like SRS, play it by different protocols like RTMP/HTTP-FLV/HLS/WebRTC.
You could publish multiple streams, they are not mutually exclusive. And play by different players, depends on the protocol you chose, please read this post.
Try it.

use mavlink without qgroundcontrol

I'm trying to conect my PX4Flow sensor to a raspberry pi. It seems that nearly everybody is using qgroundcontrol to access and control it. But as I'd like to integrate it into some bigger program, I'd like to control it with some self-written simple python code, if possible.
My aim is to:
access the camera (to measure the speed - later)
get gyrometer values
I don't need the ultra sonic sensor.
I found out that I can use MAVlink for the communication between the px4flow sensor and the raspberry pi. I cloned the git repository and followed the steps on https://github.com/mavlink/mavlink until the generation of header file (python -m mavgenerate). With that, I can generate a new python file. I don't know if this is correct, and I don't know what to do with that python file. No more file (header files) are copied or generated. How do I go on? How do I use the library? How do I even test the connection?
If I understand you correctly, you want to make a module to communicate with PX4Flow.
I have some experience in building a ground control station with ardupilot. I think the procedure is roughly the same:
Generate the proper mavlink library, what you have done by using mavgenerate. Read some guidance of mavlink communication procedure.
Read the source code in PX4Flow communication module https://github.com/PX4/Flow/blob/master/src/modules/flow/communication.c, which shows what kind of messages have been sent to client side (e.g. your communication module)
Start write the module code to communicate with PX4Flow. You may need to start with HEARTBEAT msg first to establish connections between your module and PX4Flow. Note that you can always receive HEARTBEAT messages from PX4Flow. You can start with decoding these ones.
Implement your other functionalities.
You can read sources code of QGourndControl during step 3 and step 4. Make sure to find the right module in its repo.
My communication module is built using JavaScript https://github.com/kvenux/nodegcs, if it helps.

how to capture wlan packets

I have a program on my iPad that makes a direct TCP connection (bypassing the HTTP proxy settings in the Settings menu). I have been tasked to debug this, but I've been unable to find a way to capture the data stream (and the guy who compiles the program is not very responsive).
So... I've been trying to set my wlan to "no encryption at all", booting up Kali, putting the wlan interface into monitoring mode (airmon-ng start wlan0). Then started Wireshark & tried sniffing on both mon0 & wlan0. Neither did really result into anything useful.
That's what I did till now, but I'm out of ideas.
Does anyone know what way I can do it? (preferably even using Windows?)
What I want to get in the end is a pcap file (so I can look at it in Wireshark) of the data traffic. I'm not interested in the packets per se, but in the raw data transfer of the application.
Thanks!
Use another Laptop (Windows or Linux, your choice) with WLAN card in Promiscuous mode, which will sit besides your iPad and capture all the packets on air.
Check this for more details.
What I finally did: I own an Android telephone which could be rooted (and installed "Shark for Root"). So, I enabled a hotspot, connected my iPad to it, and dumped the traffic that way. Weird thing though is that I had to reboot my device to be able to download the pcap file to my computer. It could be read on the device by SharkReader though without reboot.
bitShark is another option, and looks much more nice, but I prefer the simpler interface of Shark for Root.

NBD client and server on same machine

Is there any way to run an NBD (Network Block Device) client and server on the same machine without deadlocking the system?
I am very exhausted looking to find an answer for this. I appreciate if anyone can help.
UPDATE:
I'm writing an NBD server that talks to Google Storage system. I want to mount a file system on the NBD and backup my files. I will be hugely disappointed if I have to end up running the server on another machine. Few ideas I already had seem to lead nowhere:
telling the file system to open the block device using O_DIRECT flag to bypass the linux buffer cache
using a raw device (unfortunately, raw devices are character devices and FSes refuse to use them as underlying device)
Just for the record, having the NBD client and server on the same machine has been possible since 2008.
Use a virtual machine (not a container) - you need two kernels, but you don't need two physical machines.
Since the front page of the Sourceforge project for NBD say that a deadlock will happen "within seconds" in this scenario, I'm guessing the answer is a big "No."
Try to write a more complete question of what actual goal you're trying to accomplish. There's some times that you need to bang away at a little problem, and some times that you need to look at the big picture.

How do I ping from Flex - AIR?

I'm bored cause my development server is down and I'm running the command prompt to ping the server indefinitely so that I'll see when they stop timing out and know that I can work again. In the meantime I wanted to make an Air app that will do this for me, so I can have it chirp or alarm or do something when it starts to be able to connect to the server.
So I need to start with having AIR do the ping, does anyone know how to do this? I can't find any help on it. I can't use the HTTPService because whatever it is that is broken (think it's the VPN), our dev web site is still up.
Thanks
Otherwise you can use the NativeProcess class of the AIR 2.0 beta, and use the ping command of your operating system.
You can find informations on how to use it here.
According to the docs, SocketMonitor, descending from ServiceMonitor will check basic availability, but not a true ping. If you want to truly "ping" the server, you would need to use a socket an implement the protocol, This link to the Wikipedia article might help.
The AIR SDK offers some classes (URLMonitor, SocketMonitor) to handle this:
http://livedocs.adobe.com/flex/3/html/help.html?content=network_connectivity_1.html

Resources