Started work on external event sender
[public/netxms.git] / src / nxevent / nxevent.cpp
1 /*
2 ** NetXMS - Network Management System
3 ** Command line event sender
4 ** Copyright (C) 2003, 2004 Victor Kirhenshtein
5 **
6 ** This program is free software; you can redistribute it and/or modify
7 ** it under the terms of the GNU General Public License as published by
8 ** the Free Software Foundation; either version 2 of the License, or
9 ** (at your option) any later version.
10 **
11 ** This program is distributed in the hope that it will be useful,
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ** GNU General Public License for more details.
15 **
16 ** You should have received a copy of the GNU General Public License
17 ** along with this program; if not, write to the Free Software
18 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 **
20 ** $module: nxevent.cpp
21 **
22 **/
23
24 #include "nxevent.h"
25
26
27 //
28 // Static data
29 //
30
31 static WORD m_wServerPort = 4701;
32
33
34 //
35 // Entry point
36 //
37
38 int main(int argc, char *argv[])
39 {
40 int ch;
41 BOOL bStart = TRUE;
42
43 // Parse command line
44 opterr = 1;
45 while((ch = getopt(argc, argv, "a:bi:hlnp:qs:vw:")) != -1)
46 {
47 switch(ch)
48 {
49 case 'h': // Display help and exit
50 printf("Usage: nxevent [<options>] <server> <event_id> [<param_1> [... <param_N>]]\n"
51 "Valid options are:\n"
52 " -h : Display help and exit.\n"
53 " -p <port> : Specify server's port number. Default is %d.\n"
54 " -w <seconds> : Specify command timeout (default is 3 seconds)\n"
55 "\n", m_wServerPort);
56 bStart = FALSE;
57 break;
58 case '?':
59 bStart = FALSE;
60 break;
61 default:
62 break;
63 }
64 }
65
66 // Do requested action if everything is OK
67 if (bStart)
68 {
69 }
70
71 return 0;
72 }