8 More Discussions You Might Find Interesting
1. Infrastructure Monitoring
Sorry if this is the wrong forum
Searching for Saas Monitor service which monitor my servers which are sitting in different providers .
This monitor tool will take as less CPU as possible , and will send info about the server to main Dashboard.
The info I need is CPU / RAM / my servers status (... (1 Reply)
Discussion started by: umen
1 Replies
2. Hardware
Hi, I am experiencing troubles with dual monitors in fedora 16. During boot time both monitors are working, but when system starts one monitor automatically shut down. It happend out of the blue. Some time before when I updated system this happend but then I booted older kernel release and... (0 Replies)
Discussion started by: wakatana
0 Replies
3. UNIX for Dummies Questions & Answers
Hello,
I am trying to get some information from the sensors on my pc. But i get confuse with what i get.
I don t know where to find out which sensors watches what..
I use "sensors" under ubuntu 10.10.
Here is the result of the cmd line sudo sensors.
the temp 3 indicates 79°C which... (0 Replies)
Discussion started by: Mat_k
0 Replies
4. Shell Programming and Scripting
This Expect script provides expect with a list of IP addresses to Cisco IPS sensors and commands to configure Cisco IPS sensors. The user, password, IP addresses, prompt regex, etc. have been anonymized. In general this script will log into the sensors and send commands successfully but there are... (1 Reply)
Discussion started by: genewolfe
1 Replies
5. UNIX for Dummies Questions & Answers
I just installed lm-sensor in my terminal and it's working, however i really don't know how to analyze what I have, Any help will be appreciated, Thanks
Here is the reading in my terminal,
sensors
acpitz-virtual-0
Adapter: Virtual device
temp1: +40.0°C (crit = +124.0°C) ... (3 Replies)
Discussion started by: fvs
3 Replies
6. Shell Programming and Scripting
Hello,
I would like to write a script that use the display as an input.
In the display there is a list of file. I want to use it as an array and this would be the input in my script. Does somebody know how do I make it? (2 Replies)
Discussion started by: mig8
2 Replies
7. Shell Programming and Scripting
hi all
I am running a script monitor using source command.
the shell script monitor is used to execute a pl/sql procedure.
when i do
source monitor
and then
ps -ef | grep <procedure name>
i do not get any info
but when i do
sh monitor
and then
ps -ef | grep <procedure name>
i... (8 Replies)
Discussion started by: infyanurag
8 Replies
8. Solaris
In order to use a regular PC monitor would I need to do any configuration changes to my Ultra 5 box running Solaris 8 ? (1 Reply)
Discussion started by: mangolinux
1 Replies
libmosquitto(3) libmosquitto(3)
NAME
libmosquitto - MQTT version 3.1 client library
DESCRIPTION
This is an overview of how to use libmosquitto to create MQTT aware client programs. There may be separate man pages on each of the func-
tions described here in the future. There are also bindings for libmosquitto for C++ and Python. They are not documented here.
This is fairly incomplete, please see mosquitto.h for a better description of the functions.
STATUS
The libmosquitto api is currently regarded as experimental and unstable and may change in future releases.
LIBMOSQUITTO SYMBOL NAMES
All public functions in libmosquitto have the prefix "mosquitto_". Any other functions defined in the source code are to be treated as pri-
vate functions and may change between any release. Do not use these functions!
FUNCTIONS
LIBRARY VERSION
unsigned long mosquitto_lib_version (int *major, int *minor, int *revision);
Obtain version information about the library. If any of major, minor or revision are not NULL they will return the corresponding version
numbers. The return value is an integer representation of the complete version number (e.g. 9000 for 0.9) that can be used for comparisons.
LIBRARY INITIALISATION AND CLEANUP
int mosquitto_lib_init (void);
int mosquitto_lib_cleanup (void);
CLIENT CONSTRUCTOR/DESTRUCTOR
struct mosquitto *mosquitto_new (const char *id, void *obj);
void mosquitto_destroy (struct mosquitto *mosq);
LOGGING
int mosquitto_log_init (struct mosquitto *mosq, int priorities, int destinations);
Configure the logging settings for this client. Returns 0 on success, 1 on error.
Set priorities by ORing any of the items in the following list:
o MOSQ_LOG_INFO
o MOSQ_LOG_NOTICE
o MOSQ_LOG_WARNING
o MOSQ_LOG_ERROR
o MOSQ_LOG_DEBUG
Set destinations by ORing any of the items in the following list:
o MOSQ_LOG_NONE
o MOSQ_LOG_STDOUT
o MOSQ_LOG_STDERR
WILLS
int mosquitto_will_set (struct mosquitto *mosq, bool will, const char *topic, uint32_t payloadlen, const uint8_t *payload, int qos, bool
retain);
CONNECT/DISCONNECT
void mosquitto_connect (struct mosquitto *mosq, const char *host, int port, int keepalive, bool clean_session);
void mosquitto_reconnect (struct mosquitto *mosq);
int mosquitto_disconnect (struct mosquitto *mosq);
PUBLISH
int mosquitto_publish (struct mosquitto *mosq, uint16_t *mid, const char *topic, uint32_t payloadlen, const uint8_t *payload, int qos, bool
retain);
SUBSCRIBE/UNSUBSCRIBE
int mosquitto_subscribe (struct mosquitto *mosq, uint16_t *mid, const char *sub, int qos);
int mosquitto_unsubscribe (struct mosquitto *mosq, uint16_t *mid, const char *sub);
NETWORK LOOP
int mosquitto_loop (struct mosquitto *mosq, int timeout);
int mosquitto_loop_read (struct mosquitto *mosq);
int mosquitto_loop_write (struct mosquitto *mosq);
int mosquitto_loop_misc (struct mosquitto *mosq);
int mosquitto_socket (struct mosquitto *mosq);
CALLBACKS
See mosquitto.h
EXAMPLES
#include <mosquitto.h>
void my_message_callback(void *obj, struct mosquitto_message *message)
{
if(message->payloadlen){
printf("%s %s
", message->topic, message->payload);
}else{
printf("%s (null)
", message->topic);
}
fflush(stdout);
}
void my_connect_callback(void *obj, int result)
{
struct mosquitto *mosq = obj;
int i;
if(!result){
mosquitto_subscribe(mosq, topics[i], topic_qos);
}else{
fprintf(stderr, "Connect failed
");
}
}
void my_subscribe_callback(void *obj, uint16_t mid, int qos_count, const uint8_t *granted_qos)
{
int i;
printf("Subscribed (mid: %d): %d", mid, granted_qos[0]);
for(i=1; i<qos_count; i++){
printf(", %d", granted_qos[i]);
}
printf("
");
}
int main(int argc, char *argv[])
{
char id[30];
int i;
char *host = "localhost";
int port = 1883;
int keepalive = 60;
bool clean_session = true;
struct mosquitto *mosq = NULL;
mosq = mosquitto_new(id, NULL);
if(!mosq){
fprintf(stderr, "Error: Out of memory.
");
return 1;
}
mosquitto_log_init(mosq, MOSQ_LOG_DEBUG | MOSQ_LOG_ERR | MOSQ_LOG_WARNING
| MOSQ_LOG_NOTICE | MOSQ_LOG_INFO, MOSQ_LOG_STDERR);
mosquitto_connect_callback_set(mosq, my_connect_callback);
mosquitto_message_callback_set(mosq, my_message_callback);
mosquitto_subscribe_callback_set(mosq, my_subscribe_callback);
if(mosquitto_connect(mosq, host, port, keepalive, clean_session)){
fprintf(stderr, "Unable to connect.
");
return 1;
}
while(!mosquitto_loop(mosq, -1)){
}
mosquitto_destroy(mosq);
return 0;
}
SEE ALSO
mosquitto(8) mqtt(7)
AUTHOR
Roger Light <roger@atchoo.org>
5 February 2012 libmosquitto(3)