unknown type returned in externaltable request

Started by MHdby, March 08, 2019, 04:27:02 PM

Previous topic - Next topic

MHdby

I'm getting unknown type in the logs for an externaltable request. The request runs a powershell script which contains a command that returns text data separated by a |. The data that is returned is a text value and a number.

Script to get data

$s = "QueueName|MessagesReady";
$i = 1;
$rabbitInfo = rabbitmqctl list_queues -q name messages_ready | ConvertFrom-Csv -delimiter "`t" -Header 'Name','MessagesReady'
ForEach($item in $rabbitInfo)
{
  $s = $s + "`r`n" + $item.Name + "|" + $item.MessagesReady;
  $i = $i +1;
}
echo $s


I've also tried this as a script because the data returned is tab delimited and in the policy which contains the ExternalTable line i set separator to `t

$s = "QueueName MessagesReady";
$rabbitInfo = rabbitmqctl list_queues -q name messages_ready
echo $s $rabbitInfo



2019.03.07 15:12:29.118 *D* [CS-0(19)] Received message CMD_GET_TABLE (413)
2019.03.07 15:12:29.118 *D* [CS-0(19)] Requesting table "RabbitQueueNames"
2019.03.07 15:12:29.118 *D* [CS-0(19)] H_ExternalTable called for "RabbitQueueNames" (separator=0x0060 mode=E cmd="powershell c:\netxms\var\getRabbitQueueNames.ps1"
2019.03.07 15:12:29.118 *D* RunExternal called for "RabbitQueueNames" "Epowershell c:\netxms\var\getRabbitQueueNames.ps1"
2019.03.07 15:12:29.118 *D* RunExternal: command line is "powershell c:\netxms\var\getRabbitQueueNames.ps1"

2019.03.07 15:12:33.772 *D* [CS-0(19)] GetTableValue(): result is 0 (SUCCESS)
2019.03.07 15:12:33.772 *D* [CS-0(19)] Sending message CMD_REQUEST_COMPLETED (ID 413; size 584; compressed)
2019.03.07 15:12:33.772 *D* [CS-0(19)] Outgoing message dump:
  ** 000000: 001D0048000002480000019D00000034 ...H...H.......4
  ** 000010: 0000078078DAA5555B53D35010DE58E5 ....x..U[S.P..X.
  ** 000020: 52116B05442C508B820FC0607F830FFA R.k.D,P....`....
  ** 000030: 203338BE67521A4A86A685B4B5C32F82  38.gR.J....../.
  ** 000040: DFC32FE2CB66B3392797BED84C722EFB ../..f.9'...Lr..
  ** 000050: EDEDDB3DA744D422FBF7E8D8EBD31A0F ...=.D."........
  ** 000060: CE938C3F65FF5B3238BF64CD6A8D7402 ...?e.[28.d.j.t.
  ** 000070: 3DBAA019F9FC9E934721C655FA8DEF04 =.......G!.U....
  ** 000080: 8F47039EFDC1D7A33EDD274A0D55D7F5 .G......>.'J.U..
  ** 000090: 8BFFB45793B8FF9A76DB599C4D1AC166 ...W....v.Y.M..f
  ** 0000A0: 04DD00B3016C9EB1DC11790B92103623 .....l....y...6#
  ** 0000B0: 9A928BF98C7A58075801D9CEE26B02E1 .....zX.X....k..
  ** 0000C0: B37C08D944EDD444BE6ED86199C4F152 .|..D..D.n.a...R
  ** 0000D0: E45BF03EA45B3AA13BCDD3C4BD12DC8E .[.>.[:.;.......
  ** 0000E0: 61E7049808CF186FEA6F49707BB9BC6C a......o.oIp{..l
  ** 0000F0: 6C57ED2E0BBECEBC4DD5CE8AEC1F6A5C lW......M.....j\
  ** 000100: 767EB6BDEF6A6F55ED857405DDD45E5D v~...joU..t...^]
  ** 000110: 79BAA46B8E3FA9582A7FAD71DBF2428E y..k.?.X*..q..B.
  ** 000120: E2674DF121647186636063BD583FA07F .gM.!dq.c`c.X?..
  ** 000130: 39FEDE685C71969EFA5D97FD0EF46790 9..h\q...]....g.
  ** 000140: F4781C011557DBE7996FF0FB56F0C705 .x...W...o..V...
  ** 000150: 3E7ACCA02BF58BD0832EE2E84B9F34B4 >z..+.......K.4.
  ** 000160: CE89FFAABCDE3969EB065C6783259637 ......9i..\g.%.7
  ** 000170: B52F4D3FC5BE7CAFFD72051F43C9C2A5 ./M?..|..r..C...
  ** 000180: 1F4086A8679ACF86D6D9E47188EF6021 [email protected]..`!
  ** 000190: 9F9BA2B74173CEE1067E62ADB9F8DF2A ....As...~b....*
  ** 0001A0: F47579BE1F1497F44B156E5B70DBB0E6 .uy.....K.n[p...
  ** 0001B0: 21D7D2CE00EE63053F562581DB115CB7 !.....c.?V%...\.
  ** 0001C0: 50C798C5899E1B17DE2EF14CF93C85CA P..........L.<..
  ** 0001D0: DB27E5B7FC7CA4B896E2CC788AE77657 .'...|.....x..vW
  ** 0001E0: EF893E3C06B0726FE5BFA7FD6EF7D7C8 ..><..ro....n...
  ** 0001F0: E85813BF2FF835E52BC9BBEDA4907CDD .X../.5.+.....|.
  ** 000200: CAF9FCACF549EE87AAFA742AEECB3CEF .....I....t*..<.
  ** 000210: 079AC7A2FB24B3FB45EFFFB2F399757D .....$..E.....u}
  ** 000220: 95FE57E53FE3B5ECDE3CD4F8CD739743 ..W.?....<...s.C
  ** 000230: 0277B4F0BEB04E21E31ECCFFCB67A70E .w....N!.....g..
  ** 000240: DE36000000000000 .6......
  ** code=0x001D (CMD_REQUEST_COMPLETED) flags=0x0048 id=413 size=584 numFields=52
  ** 000010: [  1920] unknown type 120
  ** 000018: [1532220240] unknown type 16
  ** 000020: [1376873221] unknown type 68
  ** 000028: [-2112896928] unknown type 127
  ** 000030: [540227774] unknown type 103
  ** 000038: [-2035907148] unknown type 181
  ** 000040: [-540856350] unknown type 203
  ** 000048: [664256216] unknown type 76
  ** 000050: [-303178947] unknown type 167
  ** 000058: [-67639080] unknown type 235
  ** 000060: [-829191105] unknown type 101
  ** 000068: [952067277] unknown type 106
  ** 000070: [1035640857] unknown type 249
  ** 000078: [1193395797] unknown type 250
  ** 000080: [-1891171426] unknown type 253
  ** 000088: [1054680906] unknown type 13
  ** 000090: [-1946176425] unknown type 147
  ** 000098: [1994086812] unknown type 77
  ** message format error (invalid field size -602834665 at offset 0x0000A0)

Example of what is returned from the powershell script when run from shell on the server
QueueName|MessagesReady
nursing|0
smart_submit|0
results|0
smart|0
nlp-queue|0
smart-error|0
nursing-error|2
adt|0
nlp-results-error|1
mfn|0
charges|0
charges-error|0
mongo-archive|0
dta|0
outbound_sender|0
results-bad_query_id|0
dta-error|0
images|0
query_submit|0
folder_Dump|0
mongo-log-archive|0
workflow|0
nlp-error|0
mfn-error|0
labs-error|0
query_sender|0
results-missing_acctnum|0
nlp-results|0
query_error|0
daily|0
query_inbound|0
labs|0
workflow-error|0
adt-error|0
smart_sender|0
results-error|0
outbound_submit-error|0
daily-error|0
images-error|2
outbound_submit|0

In the columns on the dci i have QueueNames and MessagesReady, I have tried all sorts of combinations for type, both string, queuename as string and messagesready as int. When i let the columns auto populate by running the query from the columns box it auto selected them both as int.
I also have the setting to 60000 to allow the script command to complete in the policy