Configure Juniper SRX550 for CACTI Monitoring - cacti

I'm back with a new task. I need to monitor a Juniper SRX550 via CACTI (version 0.8.8c). I used a template supplied in one forums and it is partially working. I can monitor the CPU, Memory, temperature and storage of the device. What I need to monitor are the interfaces. I run the Assiociated data query from Cacti and got this result. Is this an OID issue? Can somebody point me to the proper OID list for this device or better if someone can show me a template to use for this device.
Running data query [13].
Found type = '3' [SNMP Query].
Found data query XML file at '/var/www/html/cacti-0.8.8c/resource/snmp_queries/interface.xml'
XML file parsed ok.
Executing SNMP get for num of indexes # '.1.3.6.1.2.1.2.1.0' Index Count: 167
Executing SNMP walk for list of indexes # '.1.3.6.1.2.1.2.2.1.1' Index Count: 167
Index found at OID: '1.3.6.1.2.1.2.2.1.1.1' value: '1'
Index found at OID: '1.3.6.1.2.1.2.2.1.1.2' value: '2'
Index found at OID: '1.3.6.1.2.1.2.2.1.1.3' value: '3'
Index found at OID: '1.3.6.1.2.1.2.2.1.1.4' value: '4'
Index found at OID: '1.3.6.1.2.1.2.2.1.1.6' value: '6'
Index found at OID: '1.3.6.1.2.1.2.2.1.1.7' value: '7'
Index found at OID: '1.3.6.1.2.1.2.2.1.1.8' value: '8'
Index found at OID: '1.3.6.1.2.1.2.2.1.1.9' value: '9'
.
.
.
Executing SNMP walk for data # '.1.3.6.1.2.1.4.20.1.2'
Found item [ifIP='10.0.0.1'] index: 22 [from regexp oid parse]
Found item [ifIP='10.0.0.16'] index: 22 [from regexp oid parse]
Found item [ifIP='10.10.10.1'] index: 13 [from regexp oid parse]
Found item [ifIP='10.10.200.45'] index: 634 [from regexp oid parse]
Found item [ifIP='10.20.100.5'] index: 618 [from regexp oid parse]
Found item [ifIP='10.62.65.2'] index: 632 [from regexp oid parse]
Found item [ifIP='10.100.102.254'] index: 644 [from regexp oid parse]
Found item [ifIP='10.100.104.254'] index: 658 [from regexp oid parse]
Found item [ifIP='10.100.200.6'] index: 640 [from regexp oid parse]
Found item [ifIP='10.100.200.14'] index: 648 [from regexp oid parse]
Found item [ifIP='30.17.0.200'] index: 550 [from regexp oid parse]
Found item [ifIP='30.18.0.200'] index: 553 [from regexp oid parse]
Found item [ifIP='118.201.184.242'] index: 601 [from regexp oid parse]
Found item [ifIP='127.0.0.1'] index: 21 [from regexp oid parse]
Found item [ifIP='128.0.0.1'] index: 22 [from regexp oid parse]
Found item [ifIP='128.0.0.4'] index: 22 [from regexp oid parse]
Found item [ifIP='128.0.1.16'] index: 22 [from regexp oid parse]
Found item [ifIP='129.16.0.1'] index: 14 [from regexp oid parse]
Found item [ifIP='172.17.129.1'] index: 624 [from regexp oid parse]
Found item [ifIP='172.17.129.5'] index: 627 [from regexp oid parse]
Found item [ifIP='192.168.4.254'] index: 617 [from regexp oid parse]
Found item [ifIP='192.168.5.2'] index: 619 [from regexp oid parse]
Found item [ifIP='192.168.6.254'] index: 630 [from regexp oid parse]
Found item [ifIP='192.168.12.254'] index: 659 [from regexp oid parse]
Found item [ifIP='192.168.201.254'] index: 602 [from regexp oid parse]
Found item [ifIP='192.168.210.254'] index: 603 [from regexp oid parse]
Found item [ifIP='192.168.247.1'] index: 621 [from regexp oid parse]
Found item [ifIP='192.168.252.1'] index: 620 [from regexp oid parse]
Found item [ifIP='192.168.255.65'] index: 622 [from regexp oid parse]
Found item [ifIP='203.116.8.2'] index: 600 [from regexp oid parse]
Found item [ifIP='203.116.17.30'] index: 616 [from regexp oid parse]
Thank you very much!

Check that you can use snmpwalk via the command line.
Try using the cacti default Traffic Templates to graph traffic. if thi works.
Link this template to your juniper host.
If it does not work, you will have to create a data and graph template based on the cacti default template.

Looks like the partial output you posted is correct.
The standard interface.xml file that comes with Cacti works great. I suggest you check the following.
Look in the "Associated Data Queries" section for your device. You should see "SNMP - Interface Statistics" and in the "Status" column you should see the number of Items and Rows discovered for the SRX550, in your example I believe there would be 167 rows.
Next when you go "Create Graphs for this host" you should see a section "Data Query [SNMP - Interface Statistics]" where you select the interfaces you want to create graphs for. Be sure to select the "graph type" in the lower right as well and hit the "create" button.

Related

Invalid input ')': expected whitespace or a variable Creating INDEX

I am trying to create BTREE index as follows:
CREATE BTREE INDEX index_r_connected FOR ()-[r:connected_to]->() on (r.source,r.target)
But I am getting following error :
> Invalid input 'I': expected whitespace, comment, '=', node labels,
> MapLiteral, a parameter, a parameter (old syntax), a relationship
> pattern, ',', FROM GRAPH, USE GRAPH, CONSTRUCT, LOAD CSV, START,
> MATCH, UNWIND, MERGE, CREATE UNIQUE, CREATE, SET, DELETE, REMOVE,
> FOREACH, WITH, CALL, RETURN, UNION, ';' or end of input (line 1,
> column 14 (offset: 13)) "CREATE BTREE INDEX index_r_connected FOR
> ()-[r:connected_to]->() on (r.source,r.target)"

Can not filter by '0000000000000' jsonb column

data is jsonb type
this query work
select id, modified_at, data,states from order where data->'id' = '2100000044078'
nice
but this not work
select id, modified_at, data,states from shop_order where data->'id' = '0000000000000'
error:
LINE 2: ..., data,states from order where data->'id' = '000000000...
^
DETAIL: Token "0000000000000" is invalid.
CONTEXT: JSON data, line 1: 0000000000000
SQL state: 22P02
Character: 161
-> returns a jsonb value, but you are trying to compare that with a text column. So Postgres tries to convert the value on the right hand side to jsonb.
Use the ->> operator instead which returns the value as text
where data->>'id' = '0000000000000'

R XML out of a database into a list

I'm trying to get a XML part out of my database into RStudio using R code.
The database is a Microsoft SQL. It looks like this:
SELECT [url]
,[attributeID]
,[propertyQuality]
,[type]
,[valueOld]
,[valueNew]
,[utcTime]
,[meaning]
,[auditSecurityID]
,[auditUserActionID]
,[auditAlarmID]
,[description]
FROM [EventLog].[dbo].[Rel_AuditChange_UserLogEntry]
INNER JOIN AuditChange ON AuditChange.id=Rel_AuditChange_UserLogEntry.auditChangeID
INNER JOIN UserLogEntry ON UserLogEntry.id=Rel_AuditChange_UserLogEntry.userLogEntryID
The value I want to extract is "valueNew", which looks something like this and is different from row to row:
<ResourceReference name="value"><ResourceId name="resourceIdVal">BatchReset</ResourceId><RevisionRef name="revision"><RevisionType name="revisionTypeVal">Specific</RevisionType><Revision name="revisionVal">1</Revision></RevisionRef></ResourceReference>
<FormatExternal name="value">BLANK</FormatExternal>
So in R I'm loading it in with:
auditChangeUserLog <- sqlQuery(con, "
SELECT [url]
,[valueOld]
,[valueNew]
,[utcTime]
FROM [EventLog].[dbo].[Rel_AuditChange_UserLogEntry]
INNER JOIN AuditChange ON AuditChange.id=Rel_AuditChange_UserLogEntry.auditChangeID
INNER JOIN UserLogEntry ON UserLogEntry.id=Rel_AuditChange_UserLogEntry.userLogEntryID
", stringsAsFactors=FALSE);
rm(con)
Then I try to get the XML into a list to add it back later behind the utcTime.
for(xml in 1:nrow(auditChangeUserLog))
{
result[xml] <- list(xmlToDataFrame(auditChangeUserLog$valueNew[xml]))
}
With the second entry from the auditChangeUserLog I get the following error:
Error in matrix(vals, length(nfields), byrow = TRUE) :
'data' must be of a vector type, was 'NULL'
If you need more information, please let me know.
Update 11.09.17:
With dput as suggested I get the following error:
"<ResourceReference name=\"value\"><ResourceId name=\"resourceIdVal\">BatchReset</ResourceId><RevisionRef name=\"revision\"><RevisionType name=\"revisionTypeVal\">Specific</RevisionType><Revision name=\"revisionVal\">1</Revision></RevisionRef></ResourceReference>"
"<FormatExternal name=\"value\">BLANK</FormatExternal>"
"<LotId name=\"value\">-</LotId>"
"<DateTimeUTCDelimited name=\"value\"><unsigned_short name=\"year\">0</unsigned_short><octet name=\"month\">0</octet><octet name=\"day\">0</octet><octet name=\"hour\">0</octet><octet name=\"minute\">0</octet><octet name=\"sec\">0</octet><unsigned_long name=\"microsec\">0<"
StartTag: invalid element name
Premature end of data in tag unsigned_long line 1
Premature end of data in tag DateTimeUTCDelimited line 1
Error: 1: StartTag: invalid element name
2: Premature end of data in tag unsigned_long line 1
3: Premature end of data in tag DateTimeUTCDelimited line 1
Update 11.09.17 (2)
I was playing around a little bit and now I have an other error:
The inpud is:
> print(auditChangeUserLog$valueNew[c(1:5)])
[1] "<AdjustmentValue name=\"value\"><AdjustmentState name=\"state\">Active</AdjustmentState><string name=\"value\">3,4</string></AdjustmentValue>"
[2] "<AdjustmentValue name=\"value\"><AdjustmentState name=\"state\">Active</AdjustmentState><string name=\"value\">5,0</string></AdjustmentValue>"
[3] "<AdjustmentValue name=\"value\"><AdjustmentState name=\"state\">Irrelevant</AdjustmentState><string name=\"value\"></string></AdjustmentValue>"
[4] "<AdjustmentValue name=\"value\"><AdjustmentState name=\"state\">Irrelevant</AdjustmentState><string name=\"value\"></string></AdjustmentValue>"
[5] "<AdjustmentValue name=\"value\"><AdjustmentState name=\"state\">Active</AdjustmentState><string name=\"value\">10</string></AdjustmentValue>"
I'm doing as I said before:
for(xml in 1:nrow(auditChangeUserLog))
{
result[xml] <- list(xmlToDataFrame(auditChangeUserLog$valueNew[xml]))
}
And I get this error message:
Input is not proper UTF-8, indicate encoding !
Bytes: 0xB5 0x6D 0x3C 0x2F
Error: 1: Input is not proper UTF-8, indicate encoding !
Bytes: 0xB5 0x6D 0x3C 0x2F
I think the biggest problem is that the XML code is from row to row a little bit different.

Tarantool multipart bitset index

box.space.test:create_index('secondary', {type='BITSET', unique=false, parts={2,'num', 3,'num'}})
---
- error: 'Can''t create or modify index ''secondary'' in space ''test'': BITSET index key can not be multipart
Tarantool 1.6.7-591-g7d4dbbb
I have table with structure:
id,
param1: {1,50,70} #values[1-256]
param2: {6,8,128} #values[1-128]
And need to:
SELECT * FROM table WHERE param1 HAVE {1,2} AND param2 HAVE {78}
So I can do it creating 256 bit + 128 bit BITSET index. How I can make it?

Stratio Lucene Index 3.0.9: Purpose of INet mapper

From the docs for the Stratio Lucene Index Plugin, the INet mapper looks interesting but there's not a lot of motivation behind it: ie. https://github.com/Stratio/cassandra-lucene-index/blob/branch-3.0.9/doc/documentation.rst#inet-mapper.
Given that it represents an IP address (typed) and is therefore distinct from being simple a string, what sort of queries can I apply to it? In particular, is it possible to do a ranged query on it?
Lucene index inet mapper is intended to map CQL inet data type. The only advantage on it is to make parsing more flexible. For example, given the following data:
CREATE TABLE t (
pk int PRIMARY KEY,
address inet
) ;
CREATE CUSTOM INDEX i ON t ()
USING 'com.stratio.cassandra.lucene.Index'
WITH OPTIONS = {
'refresh_seconds': '1',
'schema': '{
fields : {
address : {type: "inet"},
address_s : {type: "string", column: "address"}
}
}'};
INSERT INTO t(pk, address) VALUES (0, '::FFFF:8:8:8');
All these queries will found the indexed row:
SELECT * FROM t WHERE expr(i, '{filter:{type:"match", field:"address", value: "::ffFF:8:8:8"}}');
SELECT * FROM t WHERE expr(i, '{filter:{type:"match", field:"address", value: "::0:ffff:8:8:8"}}');
SELECT * FROM t WHERE expr(i, '{filter:{type:"match", field:"address", value: "0:0:0:0:ffff:8:8:8"}}');
However, the same queries wouldn't work with a string mapper:
SELECT * FROM t WHERE expr(i, '{filter:{type:"match", field:"address_s", value: "::ffFF:8:8:8"}}');
SELECT * FROM t WHERE expr(i, '{filter:{type:"match", field:"address_s", value: "::0:ffff:8:8:8"}}');
SELECT * FROM t WHERE expr(i, '{filter:{type:"match", field:"address_s", value: "0:0:0:0:ffff:8:8:8"}}');
SELECT * FROM t WHERE expr(i, '{filter:{type:"wildcard", field:"address_s", value: "*:8:8:8"}}');
Aside from this, the generated Lucene field is a string field, so there is no special treatment for wildcard or range queries, that should use the expanded format of the IP address and will have a lexicographical behaviour:
SELECT * FROM t WHERE expr(i, '{filter:{type:"wildcard", field:"address", value: "*:8:8:8"}}');
SELECT * FROM t WHERE expr(i, '{filter:{type:"range", field:"address", lower: "::FFFF:8:8:7"}}');