Zabbix Media Type Parameters not replaced correctly - api

I'm trying to call an API with Zabbix when there is a security warning
But when I receive the warning, some elements are not replaced.
However, the HOSTID parameters seems to exist in the Zabbix documentation
Here is the object I receive

{HOST.HOSTID} is a non-existent macro, there isn't a direct mapping from the api fields and the macros.
You should use {HOST.ID}
You can find the complete macro by location list here

Related

Getting generic page error in response, using JMeter in .NET site

When using .Net application,
and checking error logs,
getting below error: Object reference not set to an instance of an object.
Most probably you're sending the wrong request due to missing or improperly implemented correlation
So if you have recorded a request using HTTP(S) Test Script Recorder most probably there is at least one parameter there which is supposed to be dynamic, to wit
extracted from the previous response using a suitable JMeter Post-Processor
stored into a JMeter Variable
and the dynamic variable to be sent along with the request instead of recorded hard-coded value
In .NET web applications the most commonly used parameter is ViewState, however other may also be required like EventValidation
so given you properly handle these dynamic parameters you should start getting "good" responses, see ASP.NET Login Testing with JMeter for example handling of the dynamic parameters.
Also don't forget to add HTTP Cookie Manager to your test plan.

Salesforce Soap API on VB .NET: Attribute cannot be applied multiple times

I'm using Visual Studio 2019 to make a VB .NET to make a WPF application for windows. I'm trying to use the Salesforce SOAP api to grab data from it. In the solution explorer I right click on my project -> Add -> Service Reference -> advanced -> add web reference. I put in the link to the enterprise WSDL file I downloaded from Salesforce. In my project I have a simple test button setup that runs this to try and login:
Dim SFService = New SFAPI.SforceService
Dim loginResult = New SFAPI.LoginResult
loginResult = SFService.login(userID, userPass)
My issue is that I get some errors stating that the autogenerated References.vb has errors and they are as follows:
Error BC30663 Attribute 'GeneratedCodeAttribute' cannot be applied multiple times.
Error BC30663 Attribute 'SerializableAttribute' cannot be applied multiple times.
Error BC30663 Attribute 'DebuggerStepThroughAttribute' cannot be applied multiple times.
Error BC30663 Attribute 'DesignerCategoryAttribute' cannot be applied multiple times.
Error BC30663 Attribute 'XmlTypeAttribute' cannot be applied multiple times.
Warning Custom tool warning: Schema could not be validated. Class generation may fail or may produce incorrect results
Warning Custom tool warning: Schema validation error: Schema item 'simpleType' named 'FaultCode' from namespace 'urn:fault.enterprise.soap.sforce.com' is invalid. The Enumeration constraining facet is invalid - 'fns' is an undeclared prefix.
Warning Custom tool warning: Schema validation error: Schema item 'simpleType' named 'FaultCode' from namespace 'urn:fault.enterprise.soap.sforce.com' is invalid. The Enumeration constraining facet is invalid - 'fns' is an undeclared prefix.
Any help would be greatly appreciated. Thank you!!
In cases where you get errors related to an attribute being applied twice, this usually means that there is a duplicate vb file somewhere. Best thing to do is to hit the icon in your solution explorer to show all files: . There's probably a file being hidden/causing a duplicate here.
Ultimately, there's duplicate attributes being seen by the compiler, which is a failure, unless you specifically allow duplicate attributes.

SAPJco invoking BAPI_MATERIAL_DISPLAY

I was trying to invoke BAPI_MATERIAL_DISPLAY functional module from SAP JCO, This is how i pass my input parameter.
function.getImportParameterList().setValue("MATERIAL", "10");
From my program output i got
The material 10 does not exist or is not activated.
If I execute BAPI_MATERIAL_DISPLAY using SAP logon, iam getting the entry. Using debugger I found that,
My input is going as 00000000000010. And so returning response.
Dunno, how to handle this in a proper way in SAPJCO.
I had directly passed the value 00000000000010 from SAPJCo and this time i got an error,
com.sap.conn.jco.JCoException: (104) JCO_ERROR_SYSTEM_FAILURE: Screen output without connection to user.
Hope SAP is opening a popup. Let me know how to solve both the issues in SAPJCO
Field Material has a conversion exit routine. See also its domain MATNR in the DDIC.
These conversion exits are always called automatically by SE37 but not when the Remote Function Module is called directly - like here from outside from a a JCo program.
So if the BAPI expects to get certain parameters in their SAP internal representation format (I don't know if this is the case here), then you have to do this data transformation on your own beforehand, either by doing this purely within an own routine at Java side, or by calling the appropriate conversion routines at ABAP side via RFC.
For more details on this I recommend to study SAP note 206068.
Regarding your second question with the error message "Screen output without connection to user", I guess that this BAPI expects to have a connection to an SAP GUI for displaying the selected data. With a remote function call you don't have a SAP GUI connection by default, but you can attach a SAP GUI to your RFC connection with JCo, namely by specifying the additional logon parameter jco.client.use_sapgui=1. For this to work, an SAP GUI frontend (either for Windows or for Java) also needs to be installed on your host where JCo is running, of course.

zabbix 1.8 api get event information

How to get from api information shown in the picture?
I have the connection to api, and I couldn't find in api documentation, the method to get this event details.
thank you.
You need the event.get method. See this page in the Zabbix manual: https://www.zabbix.com/documentation/3.0/manual/api/reference/event/get
Specifically, you probably need the second example, "Retrieving events by time period".
If you want to get trigger names, use the selectRelatedObject flag. As the default source is triggers, you should not get discovery, internal and auto-registration events.
If you really use the old 1.8 version, the flag for trigger names is select_triggers - see https://www.zabbix.com/documentation/1.8/api/event/get .

which tokens/codes/ids actually need to be exchanged for google oauth

i'm trying to follow the example code on google's website here, but it seems a little broken - the javascript references getting a list of people from the server, but in the server-side code there's no reference to calling those functions of the api, it just returns an HTTP status code and a text status, so i'm wondering if there's a step missing and i'm exchanging the wrong code at the wrong time.
my current flow is
login button button clicked, magic happens, my callback gets passed an object with a whole bunch of properties in it
I take the code property from that object, and post it back to my server in an ajax request
on my server, i run the following python, where auth_code_from_js is the data of my post request:
oauth_flow = client.flow_from_clientsecrets('client_secrets.json', scope='')
credentials = oauth_flow.step2_exchange(auth_code_from_js)
python throws a FlowExchangeError with the message invalid request and no other useful information
am i missing a step? is that initial 'code' property what i'm supposed to be passing in to the 'step2_exchange' method?