Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - ophelie6989

#1
General Support / Questions about UPS
January 19, 2010, 05:37:25 PM
Hi,
i would like to manage UPS that are link to computer where an Agent is installed. I would like to have the infornations when the UPS is connected ( that s mean that power is gone off), and i would like to have also the informations about how many time that the UPS can still works?


How can i do that with the console? I have create a new data collection but it don t work.

Thank you
#2
General Support / XML file
January 13, 2010, 11:49:31 PM
Hi, i would like to know if it was possible to deploy an xml file on an agent with the NetXMS Console?

Thank you very much
#3
General Support / Questions about Netxms Console
January 06, 2010, 06:01:46 PM
Hello,

  • I would like to know how i can do to send alarms or events in the form of SNMP Trap from the Agent?
  • Also, i would like to know how we can retrieve a custom attribute when we are on the server and that we receive an event. And how we can show it in the event log?


Thank you very much
#4
General / problem with development
November 17, 2009, 06:52:50 PM
Hi,
i try to develop a monitoring in order to retrieve informations about agents. I have installed netxms agent on a computer and i try to communicate with him with an other. the communication between the two works but i have a problem for sending and receiving informations. I have looked at the code already developed by netxms and i tried to send and receive the same type of informations that the agents understand. i have done two files:  One with the code and the other with the include that i need.

Here my file in c++:
/*--Include--*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>

#include "./include/CSCPMessage.h"


int main () {
   
   /*--création de la socket grâce à la fonction socket()--*/
   //socketId est un entier qui correspond à un descripteur de socket
   int socketId = socket(AF_INET,SOCK_STREAM,0);
   
   /*--Définition de la structure utilisée avec TCP/IP afin de pouvoir contacter l'hôte--*/
   struct sockaddr_in serveur;//adresse hôte à contacter
   serveur.sin_family = AF_INET;//Protocole internet
   serveur.sin_port = htons(4700);// Port d'écoute
   serveur.sin_addr.s_addr=inet_addr("192.168.0.142"); // inet_adrr permet de spécifier une IP spécifique à utiliser
   
   
   /*--Etablissement de la connexion avec le serveur--*/
   int taille = sizeof(serveur);
   int connexion = connect(socketId, (struct sockaddr *) &serveur,taille);
   // Gestion de l'erreur de la connexion
   if (connexion ==-1)
   {
      printf("Un probleme est survenu lors de la connexion au serveur");
   }
   
   
   
   /*--Envoi du message // Sending--*/
   CSCPMessage msg;//classe
    int dwRqId;
    int i=1;
    dwRqId = i++;
    msg.SetCode(0x0067);//classe
    msg.SetId(dwRqId);//classe
    CSCP_MESSAGE  pRawMsg;//structure
    pRawMsg = msg.CreateMessage();//createMesage fonction de la classe
   
   int message;
   message=send(socketId,&pRawMsg,sizeof(msg),0);// Ecriture du message msg dans la socket ayant pour descripteur socketId
   //Gestion de l'erreur de l'envoi
   if (message == -1)
   {
      printf("Un probleme est survenu lors de l'envoi du message au serveur");
   }
     
   printf("Message envoye par le manager : %s \n",&pRawMsg);
   printf("Message envoye par le manager : %s \n",&msg);
   
    /*--Reception du message // Reception--*/
   int retour;
   CSCP_MESSAGE msg2;
    CSCPMessage msg3;
     
    retour=recv(socketId,&msg2,sizeof(msg2),0);// Lecture du message renvoyé par le serveur dans la socketayant pour descripteur socketId
   
    //Gestion de l'erreur de la reception
   if (retour == -1)
   {
      printf("Un probleme est survenu lors de la reception du message du serveur");
   } 
   
   //Affichage
    printf("Message envoye par l agent : %s \n",&msg2);
    int r=msg2.wCode;
    printf("affichage du code du message structure: %d \n",&r);
    msg3.SetCode(msg2.wCode);
    printf("Message envoye par l agent : %s \n",&msg3);
    int t=msg3.GetCode()  ;
    printf("affichage du code du message classe : %d \n",&t);
   
   
   
   

    /*--Fermeture de la socket--*/
   close(socketId);

   return 0;
}// fin du main








Here my file in .h

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#ifndef _CSCPMessage_h_
#define _CSCPMessage_h_

#define VID_RCC                     ((float)28)    /* RCC == Request Completion Code */
#define CMD_REQUEST_COMPLETED       0x001D
#define CMD_KEEPALIVE               0x0003

/*--Structure CSCP_DF--*/
typedef struct
{
   int dwVarId;       // Variable identifier
   char  bType;         // Data type
   char  bPadding;      // Padding
   int wInt16;
   union
   {
      int dwInteger;
      int qwInt64;
      double dFloat;
      struct
      {
         int dwLen;
         int szValue[1];
      } string;
   } data;
} CSCP_DF;


/*--Structure CSCP_MESSAGE--*/
typedef struct
{
   int wCode;       // Message (command) code
   int wFlags;      // Message flags
   int dwSize;     // Message size (including header) in bytes
   float dwId;       // Unique message identifier
   float dwNumVars;  // Number of variables in message
   
} CSCP_MESSAGE;

/*--Classe CSCPMessage--*/
class  CSCPMessage
{
private:
   int m_wCode;
   int m_wFlags;
   float m_dwId;
   float m_dwNumVar;    // Number of variables
   CSCP_DF **m_ppVarList;   // List of variables
   int m_nVersion;      // Protocol version

 
public:

   CSCP_MESSAGE CreateMessage(void){
                CSCP_MESSAGE msg;
                msg.wCode= m_wCode;
                return msg;
               
                };
   int GetCode(void) { return m_wCode; }
   void SetCode(int wCode) { m_wCode = wCode; }

  // DWORD GetId(void) { return m_dwId; }
   void SetId(float dwId) { m_dwId = dwId; }

   float GetVariableLong(float dwVarId);

};



class  MsgWaitQueue
{
private:
 

   void *WaitForMessageInternal(int wIsBinary, int wCode, float dwId, float dwTimeOut);
   

public:
   MsgWaitQueue();
   ~MsgWaitQueue();

   
   CSCPMessage *WaitForMessage(int wCode, int dwId, int dwTimeOut)
   {
      return (CSCPMessage *)WaitForMessageInternal(0, wCode, dwId, dwTimeOut);
   }
   
};

#endif   /* _CSCPMessage_h_ */





When i compile, i have that message:

# ./client3.e
Message envoye par le manager : g
Message envoye par le manager : g
Message envoye par l agent : g
affichage du code du message structure: -809671536
Message envoye par l agent : g
affichage du code du message classe : -809671540


The sending didn t work. can you help me, i am on it for 5 days and i don t know how to do it.

Thank you very much
#5
General Support / API IN C for agent communication
November 10, 2009, 09:33:15 PM
Hello,

I want to know if there is an API in C to develop our own communication channel with the agents. I mean, without using the dashboard. We have a custom application (for customer use) which does snmp requests to collect information on servers/workstations and we want to use the data collected by GFI Max agents to get more detailed informations that we cannot collect with snmp (like hard drive usage, services running, etc...). Is there a way to do that ? Will there be a way to do that in the future ?

Thanks,